I want to make myself a simple webapp using vb.net.I am trying to make a desktop app by which users can login and send mail or post wall(facebook) with out going into the browser. I have created the forms and all other thing using this tutorial( http://howtostartprogramming.com/vb-net/vb-net-tutorial-41-website-login/ ).This original code is working properly.
I have two problems.
1)I have made some changes of my own to the above code; to click_botton1 i have added this code.
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
WebBrowser1.Navigate("http://login.yahoo.com/")
WebBrowser1.Document.GetElementById("login").SetAttribute("value", TextBox1.Text)
WebBrowser1.Document.GetElementById("passwd").SetAttribute("value", TextBox2.Text)
WebBrowser1.Document.GetElementById(".save").InvokeMember("click")
End Sub
but this code is showing error in vb.net(not compiling)
2)After login i want to go straight to the “compose mail page” with out browsing in the web browser window. So i have added this code to the original code.
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
WebBrowser1.Document.GetElementById("login").SetAttribute("value", TextBox1.Text)
WebBrowser1.Document.GetElementById("passwd").SetAttribute("value", TextBox2.Text)
WebBrowser1.Document.GetElementById(".save").InvokeMember("click")
'NEWCODE'
webBrowser1.Navigate("http://in.mg50.mail.yahoo.com/neo/launch?.rand=de5jqdp66atmb")
End Sub
but this code is showing error. It will not go to the compose page but will redirect to login page(may be problem with cookies).
how i circumvent this problems
Advance thanks for help
I think a better approach would be to use .Net’s
System.Web.Mailclass.You will find plenty of resources if you Google it. You will need some simple things like the Yahoo (or other) SMTP server name and the account login info.
This approach will also be immune to changes in the Yahoo mail web page.