I tried to login to gmail with the code:
private void button1_Click(object sender, EventArgs e)
{
var user = new SecureString();
foreach (char c in textBox3.Text)
{
user.AppendChar(c);
}
Process.Start("C:/Users/Indish/Desktop/chrome",
"www.gmail.com", user, textBox4.Text);
}
The program says logon failure as mentioned in the question.So, if any one can help ………Thanks in advance
First of all, you are using the wrong parameters for the overload of the method that you are using. The parameters are:
So, you are sending
www.gmail.comas user name, and the user name as password, that’s why you get the error message that the login fails.You need to use the overload that takes five parameters to send arguments and login to the method:
However, that is used to provide a login for the user account that is used to run the program, not sending the login information to the program.
If the web page supports it, you can send login information in the URL:
Otherwise you would need to embed a browser control in your program to access the form after it has loaded.