我怎么能从webbrowser获取文本而没有c#中的id [英] how i can get text from webbrowser Without id in c#
问题描述
大家好
thnx阅读
此代码来自页面
http://www.travian.com.sa/12341
如何获得此链接并保存在Stirng x
这个号码12341是changin我想得到所有链接
thnx for all
hi all
thnx for reading
this code from page
http://www.travian.com.sa/12341
how I can get this link and save in Stirng x
this number 12341 is changin I want get all link
thnx for all
推荐答案
亲爱的朋友,
试一试: -
Dear Friend,
Try this:-
yourTextBox.Text = webBrowser1.Url.ToString();
**此代码将执行您要实现的目标,但您必须等到Web浏览器加载该URL或您将收到错误。
或
试试这个: -
**This code will do what you are trying to achieve but you have to wait until the web browser load the url or you will get an error.
Or
Try this:-
string url = "";
if (webBrowser1.Url != null)
{
url = webBrowser1.Url.AbsoluteUri;
}
if (url == "www.google.com")
{
label9.Text = url;
}
如果以上代码可以帮助您,请不要忘记将此标记为您的答案。
问候
Varun Sareen
If the above code helps you out then don't forget to mark this as your answer.
Regards
Varun Sareen
这篇关于我怎么能从webbrowser获取文本而没有c#中的id的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!