关于webcontrol和编码的问题 [英] Question about webcontrol and coding
问题描述
所以我想知道是否可以从C#中的webcontrol捕获生成的链接。例如,插入需要完成搜索的链接。按提交,它进入另一页。是否有可能捕获该其他页面的链接并将其用于其他目的?
谢谢
< blockquote>如果您使用 WebBrowser
控件,则可以在 HtmlDocument
中找到链接。
以下是一些示例代码
// 确保文档已加载
private void WebBrowser_DocumentCompleted( object sender,WebBrowserDocumentCompletedEventArgs e)
{
HtmlElementCollection links = WebBrowser.Document.Links;
// 做东西......
}
您可以在此处找到有关 WebBrowser
类的更多信息
< a href =http://msdn.microsoft.com/en-us/library/system.windows.forms.webbrowser(v=vs.110).aspx> http://msdn.microsoft.com/en- us / library / system.windows.forms.webbrowser(v = vs.110).aspx [ ^ ]
Hi, so I wanna know if it possible to capture a generated link from webcontrol in C#. For example inserting a link that needs to have a search done. Pressing submit and it goes into another page. Is it possible to capture the link of that other page and use it for another purpose?
Thanks
If you are using aWebBrowser
control then the links can be found in theHtmlDocument
.
Here is some example code
//Make sure document is loaded private void WebBrowser_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e) { HtmlElementCollection links = WebBrowser.Document.Links; //Do stuff... }
You can find more information here about theWebBrowser
Class here
http://msdn.microsoft.com/en-us/library/system.windows.forms.webbrowser(v=vs.110).aspx[^]
这篇关于关于webcontrol和编码的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!