Le réseau pour les développeurs >
Forums - Accueil
>
Visual C# General
>
How to login without webbrowser
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
Réponses
- 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 :-)- Proposé comme réponseAthar lundi 9 novembre 2009 17:05
- Marqué comme réponseHarry ZhuMSFT, Modérateurmercredi 11 novembre 2009 03:06
Toutes les réponses
- 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 :-)- Proposé comme réponseAthar lundi 9 novembre 2009 17:05
- Marqué comme réponseHarry ZhuMSFT, Modérateurmercredi 11 novembre 2009 03: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

