简体   繁体   中英

Third argument in “process.start()” method C#?

I used to want my program to open iexplore.exe , and then connect to facebook.com .
Now I want the program to enter the users username into Facebook. Is there any way to use a third argument in process.start() method?

Thanks in advance :)

To answer your question: NO - there is no way to use process.Start in that way.
However, I am sure that it can be done using other methods.

Sources: Personal Experience, http://msdn.microsoft.com/en-us/library/system.diagnostics.process.start.aspx

Some websites might still respond to the http://username:password@domain/folder/page syntax but unfortunately Facebook requires you to input the username and password into textboxes in the actual page.

To handle that, you might get by by simulating a POST request posting the username and password, retrieving whatever it is that Facebook returns that would allow you to continue authenticating to Facebook, but this is going to be specific for Facebook, not something inherent in the http protocol.

In other words, since you want to fork off for iexplore.exe to open Facebook, you're going to have to persuade iexplore.exe to input the username and password and then submit it, which to be honest, I hope is not going to be easy or at all possible.

You could try allowing for Internet Explorer to open the webpage, and then post keypresses to it to simulate the user typing in the username and password.

OR... you could create an addin for Internet Explorer like LastPass, that would input the username and password at the right time.

But... neither would be easy to do.

To open internet explorer and browse the Facebok page you could do something like the below:

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

For what I have understand after that you want to put the user name into the Facebook page which cannot be done using Process.Start() .

I think the only way you have to do that is by using a web-driver(like Selenium) framework which allows you to "play" with the Web UI

more info at :

http://www.qaautomation.net/?p=373

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM