void BrowserLoadError(object sender, LoadErrorEventArgs e) { string messageText = String.Format("{0} ({1} [{2}])", e.ErrorText, e.FailedUrl, e.ErrorCode); LogMessage("LOAD ERROR: " + messageText); }
private void Cwb_LoadError(object sender, CefSharp.LoadErrorEventArgs e) { try { lblStatusCode.Text = e.ErrorCode.ToString(); } catch (Exception) { throw; } }
//Обработчик события ошибки загрузки документа private void Browser_LoadError(object sender, CefSharp.LoadErrorEventArgs e) { //MessageBox.Show($"Ошибка загрузки страницыю код: {e.ErrorCode}", "Ошибка", MessageBoxButton.OK, MessageBoxImage.Error); if (e.ErrorCode == CefErrorCode.Aborted) { return; } try { Application.Current.Dispatcher.Invoke(() => { HandleLoadError((IWpfWebBrowser)sender); }); } catch { } // Debug.WriteLine($"Перезагрузка после {e.ErrorCode}; РЕАЛИЗУЙ УМНУЮ ПЕРЕЗАГРУЗКУ", "LOAD LIFECYCLE"); }
private void WebBrowser_LoadError(object sender, CefSharp.LoadErrorEventArgs e) { //重置任务 if (e.Frame.IsMain) { if (currentTask != null && (currentTask.webState == EWebbrowserState.Start || currentTask.webState == EWebbrowserState.Search || currentTask.webState == EWebbrowserState.SearchSite || currentTask.webState == EWebbrowserState.SearchPage)) { e.Browser.StopLoad(); ShowTaskEvent(this, new AppEventArgs() { message_string = string.Format("加载网页发生错误{0}网址{1},重新执行,任务{2}", e.ErrorText, e.FailedUrl, currentTask.nID) }); StartSearch(this, new AppEventArgs() { message_task = currentTask }); } } //throw new NotImplementedException(); }
//private void OnWebBrowserConsoleMessage(object sender, ConsoleMessageEventArgs e) //{ // OutputMessage = e.Message; //} //private void OnWebBrowserStatusMessage(object sender, StatusMessageEventArgs e) //{ // StatusMessage = e.Value; //} 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); }
/// <summary> /// Webブラウザーのロードエラー時 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void ChromeBrowser_LoadError(object sender, CefSharp.LoadErrorEventArgs e) { AppObject.Logger.Warn("ChromeBrowser LoadError occured. : " + e.FailedUrl); _chromeBrowser.Load("about:blank"); }
void webBrowser_LoadError(object sender, LoadErrorEventArgs e) { throw new Exception("Error " + e.ErrorCode.ToString() + ": " + e.FailedUrl + "\n" + e.ErrorText); }
private void MChromeBrowser_LoadError(object sender, LoadErrorEventArgs e) { MessageBox.Show("file type not supported yet"); }