I have a c# dll defined like this:
namespace SMSNotificationDll
{
public class smsSender
{
public void SendMessage(String number, String message)
{
ProcessStartInfo info = new ProcessStartInfo();
info.FileName = "c:\\Program Files\\Java\\jdk1.6.0_24\\bin\\java";
info.WorkingDirectory = "c:\\";
info.Arguments = "-jar SendSms.jar "+number + " "+message;
info.UseShellExecute = false;
Process.Start(info);
}
}
}
and i need to execute it from the commandline.
Is there any way I can run it through rundll32?
When I run it with this :
rundll32 SMSNotificationDll.dll, SendMessage 0749965244 hello
I get missing entry: SendMessage.
Related Story. It may seem like a waste of energy to turn your A/C on and off, but doing so actually saves you a fair amount of money, Amann says. "Air-conditioning systems run most efficiently when they're running at full speed," she explains.
Ideally, a properly operating air conditioner should cycle for roughly 15 to 20 minutes, two to three times per hour. If the temperature inside your home is very high, is much higher than the temperature that your thermostat is set at, or the outside temperature is very high, the run time will increase.
Example: If the temperature day highs are in the 90s and the lows in the high 70s, you should run an AC for about 8 hours per day. The daily temperature should be about 75°F during the day and about 72°F during the night.
See this question you can't run a .NET dll using rundll32
There is a trick to create unmanaged exports from c# too - https://www.nuget.org/packages/UnmanagedExports
How does it work? Create a new classlibrary or proceed with an existing one. Then add the UnmanagedExports Nuget package. This is pretty much all setup that is required. Now you can write any kind of static method, decorate it with [DllExport] and use it from native code. It works just like DllImport, so you can customize the marshalling of parameters/result with MarshalAsAttribute. During compilation, the task will modify the IL to add the required exports.
class Test
{
[DllExport("add", CallingConvention = CallingConvention.Cdecl)]
public static int TestExport(int left, int right)
{
return left + right;
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With