Jak można surfować za pomocą webBrowser C#


private void zaproszenie()
{
try
{
System.Windows.Forms.HtmlElementCollection htmlelementcollection1 = this.webBrowser1.Document.Body.GetElementsByTagName(“button”);
if (htmlelementcollection1.Count > 2)
{
htmlelementcollection1.Item(2).Focus();
System.Windows.Forms.SendKeys.Send(“{ENTER}”);
}
}
catch (Exception exception1)
{
}
}

private void findNextUser()
{
try
{
string str1 = this.webBrowser1.Document.Body.InnerHtml;
System.Windows.Forms.HtmlElement htmlelement1 = this.webBrowser1.Document.GetElementById(“last_photos”);
if (System.Windows.Forms.HtmlElement.op_Inequality(htmlelement1, null))
{
str1 = htmlelement1.InnerHtml;
}
string str2 = “(/profile/([0-9]+))”;
System.Text.RegularExpressions.MatchCollection matchcollection1 = System.Text.RegularExpressions.Regex.Matches(str1, str2);
if (matchcollection1.Count > 2)
{
string str3 = matchcollection1.Item(NKSpamer.Form1.GetRandNum(1, matchcollection1.Count)).Groups.Item(1).Value;
this.webBrowser1.Navigate(“http://www.nasza-klasa.pl” + str3);
}
else
{
this.webBrowser1.Navigate(“http://www.nasza-klasa.pl”);
}
}
catch (Exception exception1)
{
}
}

Advertisements
This entry was posted in C #. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s