How to login without webbrowser
- Hi everyone,
I am trying to log in one site (with valid login and password) but I dont want to use webbrowser control in my app. this would work nice with webbrowser:void PrihlasPoNacitani(object sender, WebBrowserDocumentCompletedEventArgs e) { HtmlElementCollection elements = webBrowser1.Document.GetElementsByTagName("input"); foreach (HtmlElement element in elements) { if (element.Name == "username") { element.SetAttribute("value", meno); } if (element.Name == "password") { element.SetAttribute("value", heslo); } if (element.Name == "login") { element.InvokeMember("click"); } } }
So is there any way how to do this without webbrowser. I can get automatically the source code of web page , but how to put and send my password and login into "input" type?
thanks for answers
Risposte
- sorry, I have formed it wrong...
But what I wanted was that the webBrowser should not be in my app.
So I figure it out, that I do not insert webbrowser into [design] view, but just do an instance in code like webBrowser web = new webBrowser()...
It was late nigh yesterday, that was the problem probably.
Sorry to bother you :-)- Proposto come rispostaAthar lunedì 9 novembre 2009 17.05
- Contrassegnato come rispostaHarry ZhuMSFT, Moderatoremercoledì 11 novembre 2009 3.06
Tutte le risposte
- Not sure what do you want to do?
If the post is helpful or answers your question, please mark it as such! - sorry, I have formed it wrong...
But what I wanted was that the webBrowser should not be in my app.
So I figure it out, that I do not insert webbrowser into [design] view, but just do an instance in code like webBrowser web = new webBrowser()...
It was late nigh yesterday, that was the problem probably.
Sorry to bother you :-)- Proposto come rispostaAthar lunedì 9 novembre 2009 17.05
- Contrassegnato come rispostaHarry ZhuMSFT, Moderatoremercoledì 11 novembre 2009 3.06
- thats good to at least share how to login without web browser,
I know now :)
Regards, Athar - Hi Yterbium,
Could you mark your post as a answer so people know that you have solved your problem?
cheers :)
Regards, Athar

