C#调用C语言生成的dll
using System
;
using System
.Runtime
.InteropServices
;
using System
.Windows
.Forms
;
class Example
{
[DllImport("CPUID32DLL.dll", CharSet
= CharSet
.Auto
)] public
static extern IntPtr
getCpuID1();
static void Main()
{
string CPU_ID1
= "";
int s1
= (int)getCpuID1();
CPU_ID1
= String
.Format("{0:X8}", s1
);
MessageBox
.Show(CPU_ID1
);
}
}
转载请注明原文地址: https://yun.8miu.com/read-20718.html