好吧,引擎蓋下HttpListener
類調用
[StructLayout(LayoutKind.Sequential)]
internal struct HTTPAPI_VERSION
{
internal ushort HttpApiMajorVersion;
internal ushort HttpApiMinorVersion;
}
[DllImport("httpapi.dll", CallingConvention=CallingConvention.StdCall, SetLastError=true, ExactSpelling=true)]
internal static extern unsafe uint HttpInitialize(HTTPAPI_VERSION version, uint flags, void* pReserved);
在XP:這是描述here
version.HttpApiMajorVersion = 2;
version.HttpApiMinorVersion = 0;
flags = 5;
pReserved = null;
。並設置bool supported = HttpInitialize(...) == 0;
您可以嘗試直接調用它使用的PInvoke和檢查system error code回到