Public Class Form1 Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click Dim email As String = "メールアドレス" Dim password As String = "パスワード" 'create a New browser Dim w As WebBrowser = New WebBrowser() w.Dock = DockStyle.Fill Controls.Add(w) 'you may add the controll To your windows forms If you want To see what Is going On 'latter you may Not chose to add the browser Or you can even set it to invisible... 'navigate to facebook w.Navigate("http://www.facebook.com/") 'wait a little Dim i As Integer = 0 For i = 0 To 100 System.Threading.Thread.Sleep(10) System.Windows.Forms.Application.DoEvents() Next i Dim temp As HtmlElement = Nothing 'while we find an element by id named email While temp = Nothing temp = w.Document.GetElementById("email") System.Threading.Thread.Sleep(10) System.Windows.Forms.Application.DoEvents() End While 'once we find it place the value temp.SetAttribute("value", email) temp = Nothing 'wiat till element with id pass exists While temp = Nothing temp = w.Document.GetElementById("pass") System.Threading.Thread.Sleep(10) System.Windows.Forms.Application.DoEvents() End While 'once it exist set it value equal to passowrd temp.SetAttribute("value", password) 'if you already found the last fields the button should also be there... Dim inputs As HtmlElementCollection = w.Document.GetElementsByTagName("input") Dim counter As Integer = 0 Dim enableClick As Boolean = False 'iterate through all the inputs in the document For Each btn As HtmlElement In inputs Try Dim att As String = btn.GetAttribute("tabindex") Dim Name As String = btn.GetAttribute("id") If enableClick Then 'Button Then To submit always has a differnt id. it should be after password textbox btn.InvokeMember("click") counter = counter + 1 End If If Name.ToUpper().Contains("PASS") Or att = "4" Then enableClick = True 'button should be Next To the password input End If 'try a max of 5 times If counter > 5 Then End If Catch End Try Next End Sub End Class