Пример #1
0
        public void Initialize()
        {
            if (_disposed)
            {
                throw new InvalidOperationException(Resources.HttpInitializeDispose);
            }

            if (!_initialized)
            {
                var version =
                    new HttpServerVersion {
                    Major = 1, Minor = 0
                };

                var returnCode =
                    NativeHttpServer.HttpInitialize(version, HttpInitialize.Configuration, IntPtr.Zero);

                if (returnCode != 0)
                {
                    throw new Win32Exception((int)returnCode, Resources.HttpInitializeException);
                }

                _initialized = true;
            }
        }
 public static extern uint HttpInitialize(HttpServerVersion version, HttpInitialize option, IntPtr reserved);