System.Net.WebSockets.WebSocketValidate.ThrowPlatformNotSupportedException C# (CSharp) Method

ThrowPlatformNotSupportedException() static private method

static private ThrowPlatformNotSupportedException ( ) : void
return void
        internal static void ThrowPlatformNotSupportedException()
        {
            throw new PlatformNotSupportedException(SR.net_WebSockets_UnsupportedPlatform);
        }

Usage Example

示例#1
0
        public static void CheckPlatformSupport()
        {
            bool isPlatformSupported = false;

            using (SafeLibraryHandle libHandle = Interop.mincore.LoadLibraryExW(Interop.Libraries.WinHttp, IntPtr.Zero, 0))
            {
                isPlatformSupported = Interop.mincore.GetProcAddress(libHandle, WebSocketAvailableApiCheck) != IntPtr.Zero;
            }

            if (!isPlatformSupported)
            {
                WebSocketValidate.ThrowPlatformNotSupportedException();
            }
        }