call c# written dll function from command line

G

Guest

Hello together,

i'm trying to call some functions wirtten in c# and compiled as a type
library (dll) trough the windows cmd shell. Is this generally possible?

My first idea was it to use rundll32.exe to call my user defined function,
but if i try to make a call like this: rundll32.exe mylib.dll,myFunc
Param1,Param2

The srouce code looks like this example
namespace test {
class TestClass {
public static myFunc(int param1, string param2){
/*SourceCode*/
return (ReturnData)
}
}
}

Is there Something special i have to consider?

regards
Roland
 
T

Tim Haughton

Roli79 said:
Hello together,

i'm trying to call some functions wirtten in c# and compiled as a type
library (dll) trough the windows cmd shell. Is this generally possible?

AFAIK this isn't possible. I've certainly never found myself in a position
where I've needed to look too closely at it. Why not just create a console
project that forwards command line arguments to your library?

--
Regards,

Tim Haughton

Agitek
http://agitek.co.uk
http://blogitek.com/timhaughton
 
J

John Murray

Dont know of any that exist out of the box, but you could write your own
console app that uses reflection to acquire the methodinfo on the
dll, and dynamically invoke it that way.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top