// Navigates to the given URL if it is valid. public void Navigate(String address) { if (String.IsNullOrEmpty(address)) { return; } if (address.Equals("about:blank")) { return; } if (!address.StartsWith("http://") && !address.StartsWith("https://")) { address = "http://" + address; } try { Url = address; WebBrowser1.Navigate(new Uri(address)); } catch (UriFormatException) { return; } }
private void Window_Loaded(object sender, RoutedEventArgs e) { WindowState = System.Windows.WindowState.Maximized; WebBrowser1.LoadCompleted += WebBrowser1_LoadCompleted; WebBrowser1.Navigate("http://127.0.0.1/client/index.html?isKeyboardEnabled=false"); }
private void Forward_Button_Click(object sender, EventArgs e) { if (WebBrowser1.CanGoForward) { WebBrowser1.GoForward(); } }
private void PhoneApplicationPage_Loaded(object sender, RoutedEventArgs e) { Flickr f = FlickrManager.GetInstance(); // obtain the request token from Flickr f.OAuthGetRequestTokenAsync(callbackUrl, r => { // Check if an error was returned if (r.Error != null) { Dispatcher.BeginInvoke(() => { MessageBox.Show("An error occurred getting the request token: " + r.Error.Message); }); return; } // Get the request token requestToken = r.Result; // get Authorization url string url = f.OAuthCalculateAuthorizationUrl(requestToken.Token, AuthLevel.Write); // Replace www.flickr.com with m.flickr.com for mobile version // url = url.Replace("https://www.flickr.com", "http://www.flickr.com"); // Navigate to url Dispatcher.BeginInvoke(() => { WebBrowser1.Navigate(new Uri(url)); }); }); }
//----< this function is to automatically execute some requirements in PJ#4 >---------------- private void autoexe1(object sender, EventArgs e) { tab1.SelectedItem = tab1.Items[1]; htmlbutton.RaiseEvent(new RoutedEventArgs(System.Windows.Controls.Button.ClickEvent)); if (ConvertedFiles.Items.Count > 0) { string selectedFile = ConvertedFiles.Items[0].ToString(); selectedFile = System.IO.Path.GetFileName(selectedFile); selectedFile = System.IO.Path.Combine(path_web, selectedFile); if (swin == null) { swin = new SelectionWindow(); swin.setMainWindow(this); } StreamReader sr = new StreamReader(selectedFile, Encoding.Default); string content; while ((content = sr.ReadLine()) != null) { swin.Add(content.ToString()); } swin.Show(); SetWebBrowserFeatures(11); WebBrowser1.Navigate(new Uri(selectedFile)); } time1.Stop(); time2.Tick += new EventHandler(autoexe2); time2.Interval = new TimeSpan(0, 0, 0, 2, 0); time2.Start(); }
private void Search(string query) { string searchTerm = query.Replace(" ", "+"); string searchUrl = "http://www.heise.de/preisvergleich/?fs=" + searchTerm; WebBrowser1.Navigate(new Uri(searchUrl, UriKind.Absolute)); }
private void Back_Button_Click(object sender, EventArgs e) { if (WebBrowser1.CanGoBack) { WebBrowser1.GoBack(); } }
//----< open target html file in pop-up window with html source code and in browse result with web page >--- private void HTML_MouseDoubleClick(object sender, MouseButtonEventArgs e) { string selectedFile = (string)ConvertedFiles.SelectedItem; selectedFile = System.IO.Path.Combine(path_web, selectedFile); if (unselecting) { unselecting = false; return; } if (swin == null) { swin = new SelectionWindow(); swin.setMainWindow(this); } StreamReader sr = new StreamReader(selectedFile, Encoding.Default); string content; while ((content = sr.ReadLine()) != null) { swin.Add(content.ToString()); } swin.Show(); SetWebBrowserFeatures(11); WebBrowser1.Navigate(new Uri(selectedFile)); }
//Machine ID & Subcription public void SubmitPayment_Click(object sender, RoutedEventArgs e) { //subscription try { var gateway = new StripeGateway("sk_live_DmUVQDTpe9tOV0b6kFvy9y6K00bNafAJyN"); int MonthValue = Convert.ToInt32(Month.SelectedValue); int YearValue = Convert.ToInt32(Year.Text); var cardToken = gateway.Post(new CreateStripeToken { Card = new StripeCard { Name = FirstName.Text + " " + LastName.Text, Number = CreditCardNumber.Text, Cvc = CVV.Text, ExpMonth = MonthValue, ExpYear = YearValue, AddressLine1 = Address.Text, AddressZip = Zip.Text, AddressState = State.Text, AddressCountry = (string)Country.SelectedValue, }, }); var customer = gateway.Post(new CreateStripeCustomerWithToken { Card = cardToken.Id, Description = FirstName.Text + " " + LastName.Text, Email = Email.Text, }); { customerID = customer.Id; }; } catch (Exception g) { MessageBox.Show(g.Message + Environment.NewLine + g.InnerException + Environment.NewLine + g.StackTrace + Environment.NewLine + g.Data + Environment.NewLine + g.HResult + Environment.NewLine + g.GetBaseException().Message); } try { var gateway = new StripeGateway("sk_live_DmUVQDTpe9tOV0b6kFvy9y6K00bNafAJyN"); var subscription = gateway.Post(new SubscribeStripeCustomer { CustomerId = customerID, Plan = "price_1H2kCBJHdLsTZND2MIJsWEEk", Quantity = 1, }); WebBrowser1.Visibility = Visibility.Visible; WebBrowser1.Navigate("http://alliancetechhub.com/submit.php?uid="); Productkeyentry = true; } catch (Exception f) { MessageBox.Show(f.Message + Environment.NewLine + f.InnerException + Environment.NewLine + f.StackTrace + Environment.NewLine + f.Data + Environment.NewLine + f.HResult + Environment.NewLine + f.GetBaseException().Message); } }
private void Window_Loaded(object sender, RoutedEventArgs e) { BitmapSource bms = ((MainWindow)this.Owner).CreateSnap(); Image1.Source = bms; string navstr = "<html><body style=\"margin: 0px; background: #0e0e0e;\"></body></html>"; WebBrowser1.NavigateToString(navstr); }
/// <summary> /// Retrieve the key /// </summary> /// <param name="token"></param> private void GetWorkflowMaxAccountKey(string token) { ShowProgress("Retrieving WorkflowMax Account Key...", true); const string redirectUrl = "http://www.gusha.com.au"; var wfmxUrl = "https://my.workflowmax.com/my/authorise.aspx?token=" + token + "&callbackUrl=" + HttpUtility.UrlEncode(redirectUrl); WebBrowser1.Navigate(new Uri(wfmxUrl)); ShowProgress("", false); }
public MainWindow() { InitializeComponent(); InfoTextBlock.Text = "Initialized"; InfoTextBlock.Foreground = Brushes.White; InfoTextBlock.Background = Brushes.Blue; InfoTextBlock.Padding = new Thickness(5, 5, 0, 0); WebBrowser1.Navigate("https://www.google.fi"); }
private void mnuItmBack_Click(object sender, RoutedEventArgs e) { try { WebBrowser1.GoBack(); } catch { } }
public KakaoLoginPage() { InitializeComponent(); kakaoManager = new KakaoManager(); WebBrowser1.LoadCompleted += WebBrowser1_DocumentCompleted; WebBrowser1.Navigate(KakaoApiEndPoint.KakaoLogInUrl); }
private void mnuItmForward_Click(object sender, RoutedEventArgs e) { try { WebBrowser1.GoForward(); } catch { } }
private void BrowseButton_Click(object sender, RoutedEventArgs e) { if (IsAvailable) { WebBrowser1.Navigate(TextBox1.Text); } else { MessageBox.Show("Your Popup Message"); } }
private void btnDecrypt_Click(object sender, EventArgs e) { String email = "*****@*****.**"; String token = "ebed6e6d1b579ec1"; String hash = txtInput.Text; String hashType = "md5"; String url = "http://md5decrypt.net/Api/api.php?hash=" + hash + "&hash_type=" + hashType + "&email=" + email + "&code=" + token; WebBrowser1.Navigate(url); MessageBox.Show(WebBrowser1.Document.Body.InnerText); }
private void OnShow(object sender, DependencyPropertyChangedEventArgs e) { try { WebBrowser1.NavigateToString(Properties.Resources.map); } catch (Exception) { //hmmm } WebBrowser1.ObjectForScripting = new HtmlInteropInternalClass(); }
public void FillObject(object obj, object mvm) { DataContext = obj; CurrentViewItem = obj as SessionItemViewModel; if (CurrentViewItem.Object is SessionItemViewModel) { } else { var file = new FileInfo(CurrentViewItem.Object.ToString()); //fDocReader. if (file.Extension == ".rtf") { WebBrowser1.Visibility = System.Windows.Visibility.Hidden; rch.Visibility = System.Windows.Visibility.Visible; TextRange textrange; FileStream FileStream1; textrange = new TextRange(rch.Document.ContentStart, rch.Document.ContentEnd); using (FileStream1 = new FileStream(CurrentViewItem.Object.ToString(), FileMode.OpenOrCreate)) { textrange.Load(FileStream1, System.Windows.DataFormats.Rtf); } } else if (file.Extension == ".htm" || file.Extension == ".html") { rch.Visibility = System.Windows.Visibility.Hidden; WebBrowser1.Visibility = System.Windows.Visibility.Visible; System.Uri uri = new System.Uri(file.FullName); WebBrowser1.Navigate(uri); } else if (file.Extension == ".mht") { rch.Visibility = System.Windows.Visibility.Hidden; WebBrowser1.Visibility = System.Windows.Visibility.Visible; System.Uri uri = new System.Uri(file.FullName); WebBrowser1.Navigate(uri); } } }
public MainWindow() { try { Task.Run(() => { engine = EngineFactory.Create(new EngineOptions.Builder { RenderingMode = RenderingMode.OffScreen }.Build()); browser = engine.CreateBrowser(); browser.Settings.TransparentBackgroundEnabled = true; }) .ContinueWith(t => { WebBrowser1.InitializeFrom(browser); browser .MainFrame .LoadHtml( "<html>\n" + " <body>" + " <div style='background: yellow; opacity: 0.7;'>\n" + " This text is in the yellow half-transparent div." + " </div>\n" + " <div style='background: red;'>\n" + " This text is in the red opaque div and should appear as is." + " </div>\n" + " <div>\n" + " This text is in the non-styled div and should appear as a text" + " on the completely transparent background." + " </div>\n" + " </body>\n" + " </html>"); }, TaskScheduler.FromCurrentSynchronizationContext()); InitializeComponent(); } catch (Exception exception) { Debug.WriteLine(exception); } }
public void CheckForUpdates() { HttpWebRequest request = (HttpWebRequest)WebRequest.Create("versiyonun yazdığı txt dosyası dropbox linki sonu dl=0 ile"); HttpWebResponse response = (HttpWebResponse)request.GetResponse(); System.IO.StreamReader sr = new System.IO.StreamReader(response.GetResponseStream()); string newestversion = sr.ReadToEnd(); string currentversion = Application.ProductVersion; if (newestversion.Contains(currentversion)) { txtKul.Enabled = true; txtSifre.Enabled = true; btnGiris.Enabled = true; } else { MessageBox.Show("Güncelleme Var, Lütfen Yeni Güncellemeyi İndiriniz!\n(Yeni Güncellemeyi Kayıt Etmeniz Önerilir)"); WebBrowser1.Navigate("son versiyon exe dosyasası dropbox linki sonu dl=1 ile"); } }
public void gatherLinks(ref List <Post> filtered, ref List <Tuple <string, string, string> > links) { WebBrowser1.Navigate(string.Empty); HtmlDocument fakeDoc = WebBrowser1.Document; foreach (Post Post in filtered) { string text = Post.com; text = "<HTML><body>" + text + "</body></HTML>"; fakeDoc.Write(text); } HtmlElementCollection HtmlElems = fakeDoc.Links; foreach (HtmlElement HtmlElem in HtmlElems) { string str = HtmlElem.GetAttribute("href"); Uri uri = new Uri(str); string str2 = uri.Fragment; string[] parts = uri.AbsolutePath.Split(new char[] { '/' }, StringSplitOptions.RemoveEmptyEntries); if (string.IsNullOrEmpty(str2)) { str2 = parts[2]; } else { str2 = str2.Trim(new char[] { '#', 'p' }); } if (parts.Length == 3) { links.Add(new Tuple <string, string, string>(parts[0], parts[2], str2)); } } }
private void Refresh_Button_Click(object sender, EventArgs e) { WebBrowser1.Navigate(new Uri(WebBrowser1.Source.AbsoluteUri)); }
private void buttonGit2_Click(object sender, EventArgs e) { Yonlendir2(cburl2.Text); WebBrowser1.Refresh(); }
private void Form1_Load(object sender, EventArgs e) //Form1_Load { if (!Variable.allowBakRes) { button24.Enabled = false; button25.Enabled = false; } //AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException); //If crush, call CrushHandler //寫入目前LoLToolsX版本到Log Logger.log("LoLToolsX版本: " + Application.ProductVersion, Logger.LogType.Info); Logger.log("目前客戶端 : 台服", Logger.LogType.Info); //載入LoLToolsX Logo PictureBox1.ImageLocation = Application.StartupPath + @"\logo.png"; Logger.log("LoLToolsX Logo載入成功!", Logger.LogType.Info); if (Variable.forceSelectPath) { goto SelectPath; } //取得LoL路徑 GetReg gr = new GetReg(); installPath = gr.TwPath(Application.StartupPath + @"\config.ini"); Logger.log("LoL目錄取得成功! " + installPath, Logger.LogType.Info); SelectPath: CFGFile CFGFile = new CFGFile(Application.StartupPath + @"\config.ini"); //檢查路徑是否存有 LoLTW 字串 if (!installPath.Contains("LoLTW")) { if (MessageBox.Show("無法取得LoL目錄 請手動選擇LoLTW目錄", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Information) == DialogResult.OK) { folderBrowserDialog1.ShowDialog(); Logger.log("LoL手動選擇目錄! ", Logger.LogType.Info); if (folderBrowserDialog1.SelectedPath.Contains("LoLTW")) { installPath = folderBrowserDialog1.SelectedPath; Logger.log("LoL目錄檢查成功! " + installPath, Logger.LogType.Info); CFGFile.SetValue("LoLPath", "TwPath", "\"" + installPath + "\""); CFGFile.SetValue("LoLToolsX", "Version", Application.ProductVersion.ToString()); } else { MessageBox.Show("目錄選擇錯誤 按確定退出程式", "錯誤", MessageBoxButtons.OK, MessageBoxIcon.Error); Logger.log("LoL目錄檢查失敗 ", Logger.LogType.Error); Logger.log("強制關閉程式... ", Logger.LogType.Info); Application.Exit(); } } else { Logger.log("LoL目錄選擇取消 ", Logger.LogType.Error); Logger.log("關閉程式... " + installPath, Logger.LogType.Info); Application.Exit(); } } else { CFGFile.SetValue("LoLPath", "TwPath", "\"" + installPath + "\""); CFGFile.SetValue("LoLToolsX", "Version", Application.ProductVersion.ToString()); PathLabel.Text = installPath; Logger.log("LoL目錄檢查成功! ", Logger.LogType.Info); Logger.log("LoL目錄寫入成功! " + installPath, Logger.LogType.Info); } //CFGFile = null; if (Variable.allowUpdate) { //CFGFile checkAutoUpdate = new CFGFile(Application.StartupPath + @"\config.ini"); if (CFGFile.GetValue("LoLToolsX", "AutoUpdate") == "true") { Variable.updating = true; this.checkBox1.Checked = false; Thread updateThread = new Thread(CheckUpdate.checkUpdate); //開始檢查更新 updateThread.Start(); } else { this.checkBox1.Checked = true; } } else { button23.Enabled = false; } //檢查語言檔更新 //Thread langUpdate = new Thread(LangUpdate.CheckLangUpdate); //langUpdate.Start(); //string test = Application.StartupPath; //MessageBox.Show(test); ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //取得目前伺服器 CheckProp cp = new CheckProp(); cp.CheckPropFL(installPath); serverLocation.Text = cp.currentLoc; notifyIcon1.Visible = false; PathLabel.Text = installPath; //取得版本資訊 toolsVersion.Text = Application.ProductVersion.ToString(); LoLVersionLabel.Text = GetLoLVer(); //在綫統計使用人數 try { WebBrowser1.Navigate("http://nitroxenon.com/loltoolsx/stat.html"); } catch (Exception e2) { Logger.log("使用人數統計失敗", Logger.LogType.Error); Logger.log(e2); } //刪除物件 cp = null; gr = null; string[] skins = File.ReadAllLines(Application.StartupPath + @"\Skin.txt"); foreach (string s in skins) { installedSkin.Items.Add(s); } //Variable.tw_installPath = installPath; Variable.curClient = "台服"; }
private void Button1_Click(System.Object sender, System.EventArgs e) { WebBrowser1.Navigate(TextBox2.Text + TextBox1.Text + TextBox3.Text); WebBrowser2.Navigate(TextBox9.Text + TextBox1.Text + TextBox8.Text); }
private void Panel3_Click(object sender, System.EventArgs e) { WebBrowser1.Navigate(TextBox2.Text + TextBox1.Text + TextBox3.Text); WebBrowser2.Navigate(TextBox9.Text + TextBox1.Text + TextBox8.Text); }
private void pictureBox5_Click_3(object sender, EventArgs e) { Yonlendir(cburl.Text); WebBrowser1.Refresh(); gecmisyukle(); }
private void ButtonGo_Click(object sender, RoutedEventArgs e) { WebBrowser1.Navigate(TextBox1.Text); }
private void pictureBox2_Click(object sender, EventArgs e) { WebBrowser1.Navigate(TextBox2.Text + TextBox1.Text + TextBox3.Text); WebBrowser2.Navigate(TextBox9.Text + TextBox1.Text + TextBox8.Text); }