好吧,引擎盖下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回到