int WSAIoctl(
SOCKET s,
DWORD dwIoControlCode, 
LPVOID lpvInBuffer,
DWORD cbInBuffer, 
LPVOID lpvOutBuffer, 
DWORD cbOutBuffer, 
LPDWORD lpcbBytesReturned, 
LPWSAOVERLAPPED lpOverlapped, 
LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine
);
DWORD 是什么数据类型,引入那个命名空间解决这个问题

解决方案 »

  1.   

    DWORD是双字类型,是WIN32中的数据类型,在.NET中它对应的数据类型为System.UInt32
      

  2.   

    那我要导入那个命名空间呢,否则编译器总是报缺少using引用,谢谢
      

  3.   

    .NET里面是没有DWORD的,你那个是不是DllImport部分的语句啊?上www.pinvoke.net看看
      

  4.   

    int WSAIoctl(SOCKET s,uint dwIoControlCode,IntPtr  lpvInBuffer,uint cbInBuffer,IntPtr lpvOutBuffer,uint cbOutBuffer,IntPtr lpcbBytesReturned,IntPtr lpOverlapped,IntPtr lpCompletionRoutine);
    或者
    unsafe extern int WSAIoctl(SOCKET s,uint dwIoControlCode,void *  lpvInBuffer,uint cbInBuffer,void * lpvOutBuffer,uint cbOutBuffer,uint * lpcbBytesReturned,WSAOVERLAPPED * lpOverlapped,WSAOVERLAPPED_COMPLETION_ROUTINE *lpCompletionRoutine);
      

  5.   

    对应的是System.UInt32就是说在.NET中用System.UInt32代替WIN32的DWORD
      

  6.   

    int, long, long int, INT32, LONG32, BOOL , INT (System.Int32)
    __int64, INT64, LONGLONG(System.Int64)
    unsigned char, UINT8, UCHAR, BYTE(System.Byte)
    unsigned short, UINT16, USHORT, WORD, ATOM, WCHAR , __wchar_t(System.UInt16)
    unsigned, unsigned int, UINT32, ULONG32, DWORD32, ULONG, DWORD, UINT(System.UInt32)
    unsigned __int64, UINT64, DWORDLONG, ULONGLONG(System.UInt64)
    float, FLOAT(System.Single)
    double, long double, DOUBLE(System.Double)上面是一个WIN32类型和CLR类型的对照,括号外是WIN32类型,括号中是CLR类型