Skip to content

Access webpage with credentials using winforms in C#.Net

ansar

Asked Mar 20, 2008, 10:17 PM EDT2 answers
Share
LinkedInX

Hi all,

Thanx in adv,

i have a windows application which gets the username and password for a webpage.

On clicking a button in the windows application after filling the username and password, it has to open that particular webpage using the credentials.

Kindly tell some method to acheive.

I followed

System.Diagnostics.process.start("Weblink", username, password, domain);

it is giving Win32 exception stating "Parameter is Incorrect".

I think it is problem with the domain name what i have given.

what should be the domain name in Webpage.

Regards,

Ansar

2 Answers

Know the answer? Post it. Somebody with the same question will find it here.

  • Bechir Bejaoui
    0
    I think that you should configure you web application identification as a windows indentification
    To enable your web application to be identified by the windows OS you have to add those tags to your web config file
    HTML / XML
    <system.web>
      <authentication mode="Windows"/>
      <identity impersonate="true"/>
    </system.web>
    
    or you can try this
    
    <system.web>
      <processModel enable="true"
        userName="put the user id"
        password="put the password here"/>
    </system.web>
    0
  • 0

    Thanx for your reply,

    But this will not work out in my case.

    My problem is

    1. I am having a windows application which gets the username and password from the user and it also have a button.

    2. After entering the username and password, the user has to click that button.

    3. On user click what the application supposed to do is it has to open the required webpage say for example(www.gmail.com) and it should login in that webpage using the username and password.

    4. For this i have used the follwing code in the button click event.

    System.disgnostics.process.start("www.gmail.com",username,password,domain)

    5. The problem is username and password is given by the user but what should be the content in the domain field.

    Kindly help me

    Best Regards,

    Ansar

    0