Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1082001
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T22:14:29+00:00 2026-05-16T22:14:29+00:00

My situation: I’m running a C# testing program which allows me to configure certain

  • 0

My situation:

I’m running a C# testing program which allows me to configure certain browser “steps”, like going to an URL or clicking on a button. There’s also the posibility to enter a domain, username and password. When running the program it will invoke another program* with the (if entered) username and password. This new program will run Internet Explorer (through Watin) and perform the “steps”.

The problem here is that when I go to a URL which requires a certain user, it will give me “You are not authorized to view this page”. When I manually (Internet Explorer – Run As) login with the same user (and i checked the credentials more than once) it will give me authorization just fine.

Something I allready tested: when running a localhost page (which would display the current user) I get authorization both manually and automatically through the program. Oh and: the program runs fine when I do not configure the credentials (it will skip the if statement)

The code I use to launch the second program:

System.Diagnostics.ProcessStartInfo psi = new System.Diagnostics.ProcessStartInfo();
            if (!string.IsNullOrEmpty(Username))
            {
                System.Security.SecureString secPw = new System.Security.SecureString();
                foreach (char c in Password)
                {
                    secPw.AppendChar(c);
                }
                psi.UserName = Username;
                psi.Password = secPw;
                psi.Domain = Domain;
            }
            psi.WorkingDirectory = "c:\\temp";
            psi.FileName = Path.Combine("c:\\temp", fileName);
            psi.Arguments = xmlStepFilename;
            psi.UseShellExecute = false;
            psi.EnvironmentVariables["TMP"] = "c:\\temp";

            var process = new System.Diagnostics.Process();
            process.StartInfo = psi;
            process.Start();

Thank you for your time!

(* The new program was implemented, because Internet explorer would always run under the user the initial application was started with, and it didn’t seem possible to run Internet Explorer with another username/password because Watin did not support this… But that is not part of the problem)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T22:14:30+00:00Added an answer on May 16, 2026 at 10:14 pm

    psi.LoadUserProfile = true; is the right answer. It seems we have a professional in the house 🙂 Thank Commander Keen!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Situation: I have an index page which loads pages into it with ajax as
Situation: I have some persons with certain skills and they can/might belong to more
Situation: I am trying to write a efficient query using "LIKE" statement to look
Situation: I am writing a program in C that maintains a number of threads.
Situation I'd like to make an RPC interface easier to use. This is a
Situation: I have a sendersocket which is bound to localhost UDP port 33100. I
Situation: I am writing a program to solve for primes. I need to solve
Situation: I'm implementing a list-like container that supports a Pop() function that should return
[Situation] I have a custom item control which I add to a stack panel
Situation: A user submits a url and my php script adds that url to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.