在C#工程引用System.Runtime.InteropServices,代码中
[DllImport("Test.dll")]
public static extern unsafe int TestAbc(string sAbc);
编译加/unsafe例如 C#中实现beep
using System.Runtime.InteropServices;Class DEMO
{
[DllImport("Kernel32.dll")]
public static extern int Beep(uint dwFreq,uint dwDuration);
public void MyBeep()
{
Beep(100,100); }
}
[DllImport("Test.dll")]
public static extern unsafe int TestAbc(string sAbc);
编译加/unsafe例如 C#中实现beep
using System.Runtime.InteropServices;Class DEMO
{
[DllImport("Kernel32.dll")]
public static extern int Beep(uint dwFreq,uint dwDuration);
public void MyBeep()
{
Beep(100,100); }
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货