As Christian requested, I am trying to make a friend deleter for Gaia, and that's what I put in VB.NET:
I was wondering how I could load the HTMLcode1 (where values are replaced) in the current WebBrowser, and if there is another way to do it.Code:Public Class Form1 Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load WebBrowser1.Navigate("www.gaiaonline.com") End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click WebBrowser1.Navigate("www.gaiaonline.com/friends") End Sub Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click Dim HTMLcode, HTMLcode1 As String HTMLcode = WebBrowser1.DocumentText HTMLcode1 = HTMLcode.Replace("flag;", "true;") HTMLcode1 = HTMLcode.Replace("Remove Friend", "True") RichTextBox1.Text = HTMLcode1 End Sub End Class
Results 1 to 11 of 11
Thread: Friend Delete program
- 06 Apr. 2011 06:40pm #1
Friend Delete program
- 06 Apr. 2011 07:34pm #2
What do I add.
Buttons,
Textboxes,
webbrowser?
And where do i place the code?
- 06 Apr. 2011 07:41pm #3
- 06 Apr. 2011 08:03pm #4
Probably the programming section would have better help.
I'm not sure of the properties of a Web browser, however you might want to use HTTP Wrappers in order to send requests to the server. That way you can just send a POST request with the proper parameters to delete a friend.
Sorry if you didn't understand this.
- 06 Apr. 2011 08:18pm #5
Start taking advantage of invokemember. It'll be way simpler.
PHP Code:
private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
{
if (webBrowser1.Url.ToString() == "www.gaiaonline.com/friends") {
webBrowser1.Document.GetElementById("select_all_checkbox").InvokeMember("Click");
webBrowser1.Document.GetElementById("removefriend").InvokeMember("Click");
label1.Text = "Done";
}
}
Last edited by Elliot; 06 Apr. 2011 at 08:20pm.
// Signature
- 06 Apr. 2011 10:20pm #6
That's what I am hardly trying to learn during those two past months, how to make use of HTTP wrappers, in vain.
@Thomas: Thank you for the answer, here's my new code:
Code:Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click For i As Integer = 0 To NumberOfFriendPages.Text If WebBrowser1.Url.ToString() = "www.gaiaonline.com/friends" Then WebBrowser1.Document.GetElementById("select_all_checkbox").InvokeMember("click") WebBrowser1.Document.GetElementById("removefriend").InvokeMember("click") MessageBox.Show("Done") End If WebBrowser1.Refresh() Next End Sub
Last edited by ~Shieru No Tamashi~; 06 Apr. 2011 at 10:50pm.
- 07 Apr. 2011 01:58pm #7
- 07 Apr. 2011 10:13pm #8
- 07 Apr. 2011 10:22pm #9
- 07 Apr. 2011 10:49pm #10
Example in C#.
PHP Code:public static Boolean Remove_Friend(int UserID)
{
if (Wrapper.Post(Gaia_URL_Nor + Gaia_URL_NorAddFriend + UserID + "/", "action=Remove Friend&user_ids[]=" + UserID, Gaia_URL_Nor + Gaia_URL_NorAddFriend + UserID + "/").IndexOf("Success") > -1)
{
return true;
}
return false;
}
- 09 Apr. 2011 08:09am #11
- Age
- 29
- Join Date
- Aug. 2010
- Location
- In Your FRIDGE with a laptop :)
- Posts
- 1,360
- Reputation
- 89
- LCash
- 0.00
i could try putting it together in a window? if whoever wanted it wanted me too ive got nothing better to do atm :1
"I try to contribute hopefully im doing my job. " :0,
+rep me if you like the pics i draw for you?
Looks like we got ourselves our own ghetto LG chat room
Anyone want an RS account? Add me Pl0x
MSN: sonic_benny@yahoo.com