Click here to Skip to main content
15,921,643 members
Please Sign up or sign in to vote.
2.20/5 (3 votes)
See more:
I tried the below code:

C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Security;
using System.ComponentModel.Design;
using System.Windows.Forms;
using System.Diagnostics;


public partial class Test : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void Button1_Click(object sender, EventArgs e)
    {

        SecureString password= new SecureString();
      
       password.AppendChar( 'A' );
       password.AppendChar( 'a' );
       password.AppendChar( 's' );
       password.AppendChar( 'h' );
       password.AppendChar( 'i' );
       password.AppendChar( 's' );
       password.AppendChar( 'h' );


         try
         {
             Process.Start("Firefox.exe", "www.facebook.com","abc@y.com" ,password,".com");
         }
         catch (Exception ex)
         {
             MessageBox.Show(ex.Message);
         }
    }
    
}


Error: The parameter is incorrect.

What should the correct parameter be?

:rose:
With Regards
Er.Aashish Khandelwal
Posted
Updated 18-Dec-09 15:53pm
v4

It would help to know what the exact error is, I get:
Logon failure: unknown user name or bad password


So what is the error you get?

Try launching wastebook from the command line, see which paramaters you need to supply and then replicate.
 
Share this answer
 
I'm not sure this will even compile. There aren't any overloaded versions of Process.Start() that take 4 parameters. Additionally, if you are attempting to log into a website automatically using Process.Start(), I don't think that is possible.


Process.Start(string filename , string arguments , string username , SecureString password , string domain);


Above statement is syntactically correct.

Although the statement is syntactically correct it is to do with launching the process i.e. which user to launch the process and their password and the domain the user belongs to.

This has nothing to do with the arguments sent to firefox which are covered in string arguments.

As for launching Firefox and logining into facebook I don't think it is possible
 
Share this answer
 
v2
The domain argument would be "facebook.com".

I just found the documentation for this version of Process.Start(). I was looking at the .net 2.0 spec's before. You will definitely not be able to use this in the way you are attempting. The user name refers to a user in your domain. The password is the user's password. the domain argument is the domain the user belongs to.
 
Share this answer
 
v2
I'm not sure this will even compile. There aren't any overloaded versions of Process.Start() that take 4 parameters.

Ignore the above statement. I was referring to an older version of .net.

This still stands:

Additionally, if you are attempting to log into a website automatically using Process.Start(), I don't think that is possible.
 
Share this answer
 
v3
I'm not sure this will even compile. There aren't any overloaded versions of Process.Start() that take 4 parameters. Additionally, if you are attempting to log into a website automatically using Process.Start(), I don't think that is possible.





Process.Start(string filaname , string arguments , string username , SecureString password , string domain);


Above statememt is syntatically correct.

Moreover, i don't know the "domain"

:thumbsup:
Cheers
Er.Aashish Khandelwal
 
Share this answer
 
It would help to know what the exact error is, I get:

Logon failure: unknown user name or bad password




Error==>>The parameter is incorrect.


Then i tried


Process.Start("Firefox.exe", "www.facebook.com", "", password, "");

Error=>>System cannot find the file specified
 
Share this answer
 
Although the statement is syntactically correct it is to do with launching the process i.e. which user to launch the process and their password and the domain the user belongs to.

This has nothing to do with the arguments sent to firefox which are covered in string arguments.

As for launching Firefox and logining into facebook I don't think it is possible



I Agree with you.So now you got,what i want to do.

So tell me how could i pass loginid,password to the website login page when i click on the hyperlinks contained by datagrid
 
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