Exemplo n.º 1
0
        private void OnWebBrowserLoadError(object sender, LoadErrorEventArgs args)
        {
            // Don't display an error for downloaded files where the user aborted the download.
            if (args.ErrorCode == CefErrorCode.Aborted)
            {
                return;
            }

            var errorMessage = "<html><body><h2>Failed to load URL " + args.FailedUrl +
                               " with error " + args.ErrorText + " (" + args.ErrorCode +
                               ").</h2></body></html>";

            webBrowser.LoadHtml(errorMessage, args.FailedUrl);
        }
Exemplo n.º 2
0
        private void OnWebBrowserLoadError(string failedUrl, CefErrorCode errorCode, string errorText)
        {
            // Don't display an error for downloaded files where the user aborted the download.
            if (errorCode == CefErrorCode.Aborted)
            {
                return;
            }

            var errorMessage = "<html><body><h2>Failed to load URL " + failedUrl +
                               " with error " + errorText + " (" + errorCode +
                               ").</h2></body></html>";

            webBrowser.LoadHtml(errorMessage, failedUrl);
        }