execute a "form" from another account

gregoire77

New member
Joined
Sep 19, 2018
Messages
2
Programming Experience
Beginner
Hello everyone,

I introduce myself, my name is Greg. I am stuck on an application that we use for "Windows" account creations. I must be able to execute a "form" from another account. When can I do? I thought I would use a "process.startinfo" but I could not indicate the "file" ... thank you for your help.

here is the code that poses me problem, the "showDialog" option was used before a change of account


System.Diagnostics.Process proc = new System.Diagnostics.Process();
proc.StartInfo.UseShellExecute = false;
proc.StartInfo.Arguments = "";
proc.StartInfo.Domain = useradmin.Domaine;
proc.StartInfo.UserName = useradmin.Login;
proc.StartInfo.Password = useradmin.Password;
proc.StartInfo.LoadUserProfile = true;

proc.Start();


// Application.EnableVisualStyles();
// Application.SetCompatibleTextRenderingDefault(false);
// Application.Run(new formulaire_1());

// var application = new formulaire_1();
// application.ShowDialog();
 

JohnH

C# Forum Moderator
Staff member
Joined
Apr 23, 2011
Messages
532
Location
Norway
Programming Experience
10+

gregoire77

New member
Joined
Sep 19, 2018
Messages
2
Programming Experience
Beginner
Hello,
Thank you for your answer, however my problem is the following.
The first "FORM" must be executed with the "user windows current", then in a second time the "FORM2" must be it with a specific user. I tried to set up the "impersonation" without result to date.
 
Top Bottom