using SHDocVw;
using mshtml;
String url = "YourWebSite.com/login.aspx";
IHTMLElementCollection htmlCollection;
HTMLDocument html;
HTMLInputElement htmlInput;
object obj = null;
InternetExplorer ie=new InternetExplorer();
ie.Navigate(url,ref obj,ref obj,ref obj,ref obj);
while (ie.Busy)
{
Application.DoEvents();
}
html =(HTMLDocument)ie.Document;
ie.Visible = true;
htmlCollection= html.getElementsByTagName("input");
foreach(HTMLInputElement input in htmlCollection)
{
if (input.name == "txtUserName") //txtUserName is your login.aspx page text control
input.innerText = "mylogin"; // assign username in login.aspx page
if (input.name == "txtPassword") //txtPassword is your login.aspx page text control
input.innerText = "mypassword"; //assign password in login.aspx page
if (input.name == "txtMACAddress") //txtMACAddress is your login.aspx text control
input.innerText = "00:00:11:22:33:55"; //assign macAddress in login page
}
while (ie.Busy)
{
Application.DoEvents();
}
htmlCollection = html.getElementsByTagName("input");
foreach (HTMLButtonElement btn in htmlCollection)
{
if (btn.name == "btnLogin")
btn.click();
}
while (ie.Busy)
{
Application.DoEvents();
}
Note: Add "following reference in your Application
1) Add Reference --> Browse --> .System32(search inside windows folder) -->SHDocVw.exe
2) Add Reference --> .Net --> Microsoft.mshtml
Note: To get MAC address of machine please ref Article "http://code4developer.blogspot.com/2009/09/get-mac-address-of-client-machine-using.html"