c# - How can I get the title of a page on another site? -


pretty long question;

how can following in c#:

open web page (preferably not visible) check whether page redirects different page (site down, 404, etc.) check if title not equal said string

then separately, (they need click confirm button)

open browser, , go address of first (it'll one) hyperlink on site.

i literally have been looking on google ages , haven't found similar need.

whether give me link site tutorial on area of programming or actual source code doesn't make difference me.

you use webrequest or httpwebrequest, if want browser ui need use webbrowser control: http://msdn.microsoft.com/en-us/library/system.windows.forms.webbrowser.aspx

you need handle completion event navigate call load page you:

webbrowser mywebbrowser = new webbrowser();  webbrowser1.navigating += new webbrowsernavigatingeventhandler(webbrowser1_idontknow); mywebbrowser.navigate("http://myurl.com/mypage.htm"); 

you can implement handler follows, , interact webbrowser ui necessary... documenttext property contains html of loaded web page:

private void webbrowser1_idontknow(object sender, webbrowsernavigatingeventargs e)     {        checkhtmlconfirmandredirect(webbrowser1.documenttext);      } 

Comments

Popular posts from this blog

linux - Mailx and Gmail nss config dir -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -