Commit 3de915644994cbfd41ff7cef984f45ea927409cd
1 parent
c025ad82
修改检察院名称跳转问题
Showing
1 changed file
with
10 additions
and
0 deletions
FRControl/WebView.cs
| ... | ... | @@ -79,6 +79,7 @@ namespace FRControl |
| 79 | 79 | if (elem.GetAttribute("className").ToString().Equals("lanmu")) |
| 80 | 80 | { |
| 81 | 81 | elem.SetAttribute("className", "lanmuc"); |
| 82 | + elem.Click += new HtmlElementEventHandler(elem_Click); | |
| 82 | 83 | } |
| 83 | 84 | |
| 84 | 85 | //Console.WriteLine(elem.InnerHtml+",class="+ elem.GetAttribute("className").ToString()); |
| ... | ... | @@ -112,6 +113,15 @@ namespace FRControl |
| 112 | 113 | xbili, IntPtr.Zero); |
| 113 | 114 | } |
| 114 | 115 | |
| 116 | + public void elem_Click(object sender, EventArgs e) | |
| 117 | + { | |
| 118 | + HtmlElement elem = (HtmlElement)sender; | |
| 119 | + String url = "https://www.12309.gov.cn" + elem.GetAttribute("url").ToString(); | |
| 120 | + //Console.WriteLine(url); | |
| 121 | + //Console.WriteLine(elem.InnerHtml + ",class=" + elem.GetAttribute("className").ToString()+"url:"+ elem.GetAttribute("url").ToString()); | |
| 122 | + this.webBrowser1.Navigate(url); | |
| 123 | + } | |
| 124 | + | |
| 115 | 125 | private void Window_Error(object sender, HtmlElementErrorEventArgs e) |
| 116 | 126 | { |
| 117 | 127 | e.Handled = true; | ... | ... |