Click here to Skip to main content
15,886,830 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to open website login using windows form application.
Posted
Comments
Richard MacCutchan 31-May-12 4:26am    
And what is your problem?
sanjeevbaadsah 31-May-12 4:31am    
i want to create application that will automatically login my attandence website.
Richard MacCutchan 31-May-12 4:44am    
I understand that, but you have not said which part of it you are having problems with.

You are talking about website automation. If your windows forms has a web browser control in it you could do website actions (i.e. button clicks, read textboxes) quite easily.

Here is a good reference site for more detail:
http://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/23dfc3f9-3274-4929-8dc5-9ba543f4911d[^]
 
Share this answer
 
Create a Windows Application

Add WebBrowser Control
Write Code to Navigate Site
C#
public bool isrun;
        private void Form1_Load(object sender, EventArgs e)
        {
            webBrowser1.Url = new Uri("http://www.yourwebsite.com");
        }


after this add a event DocumentCompleted
which occurs where page completely loaded

C#
        private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
        {
        if(!isrun)
        {
            webBrowser1.Document.GetElementById("login_name").InnerText = "uid";
            webBrowser1.Document.GetElementById("passwd").InnerText = "pwd";
            webBrowser1.Document.GetElementById("buttonid_login").InvokeMember("click");      
           isrun=true;
        }

}
 
Share this answer
 
Comments
sanjeevbaadsah 31-May-12 4:58am    
thanks a lot.:):)
You should use Web Browser Control In Windows Application
Thanks
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900