我的ac #dll定义如下:
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);
}
}
}
Run Code Online (Sandbox Code Playgroud)
我需要从命令行执行它.
有什么方法可以通过rundll32运行它吗?
当我用它运行它:
rundll32 SMSNotificationDll.dll, SendMessage 0749965244 hello
Run Code Online (Sandbox Code Playgroud)
我错过了条目:SendMessage.
我有一个程序,我需要创建一个DLL,希望在C#中.该程序是用Delphi编写的,我有一个代码的接口文件.该接口使用stdcall调用约定.
是否可以创建符合接口的C#DLL并可以在Delphi应用程序中使用?
是否有一些示例代码演示如何将C#DLL编码为stdcall接口方法?
我想创建一个可以从非托管代码(Delphi 5)访问的.NET程序集.
我找到了Unmanaged Exports并按照那里的步骤进行了操作但是我甚至无法成功编译基本示例:
using RGiesecke.DllExport;
namespace DelphiNET
{
public class Class1
{
[DllExport("add")]
public static int Add(int left, int right)
{
return left + right;
}
}
}
Run Code Online (Sandbox Code Playgroud)
DelphiNET.csproj 项目文件:
...
<ItemGroup>
<Compile Include="Class1.cs" />
<Compile Include="DllExport\DllExportAttribute.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="DllExport\RGiesecke.DllExport.targets" />
...
Run Code Online (Sandbox Code Playgroud)
这是错误:
------ Build started: Project: DelphiNET, Configuration: Release Any CPU ------
c:\WINDOWS\Microsoft.NET\Framework\v3.5\Csc.exe /noconfig /nowarn:1701,1702 /errorreport:prompt /warn:4 /define:TRACE /debug:pdbonly /filealign:512 /optimize+ /out:obj\Release\DelphiNET.dll /target:library Class1.cs DllExport\DllExportAttribute.cs Properties\AssemblyInfo.cs
Compile complete -- …Run Code Online (Sandbox Code Playgroud)