用Visual C#调用Windows API函数
http://www.51blog.net/showArticle.asp?art_ID=714sample:
[DllImport("Netapi32", CharSet=CharSet.Unicode)]
public static extern int NetMessageBufferSend(string servername, string msgname, string fromname, string buf, int buflen);

解决方案 »

  1.   

    int IC_InitComm(short port);
    int IC_InitCommAdvanced(short port);
    short IC_ExitComm(int idComDev);
    short IC_Status(int idComDev);
    short IC_Down(int idComDev);
      

  2.   

    HANDLE   __stdcall  IC_InitComm(__int16 port);
    c#
    [DllImport("yourDllName", CharSet=CharSet.ANSI)]
    public static extern IntPtr IC_INitComm(short port);__int16  __stdcall  IC_ExitComm(HANDLE idComDev);
    c#
    [DllImport("yourDllName", CharSet=CharSet.ANSI)]
    public static extern int IC_ExitComm(IntPtr idComDev);
      

  3.   

    [DllImport("***.dll")] 
      private static extern IntPtr IC_InitComm(  short port); ,,,,,,[DllImport("***.dll")] 
      private static extern short IC_ExitComm( IntPtr idComDev);
      

  4.   

    就是调用API函数吧
    http://www.yesky.com/20020307/1600638.shtml