Process pro = new Process();
pro.StartInfo.UserName = "aaa_iuser"; // 指定以特定使用者執行
string pw = "P@$$w0rd";
SecureString ss = new SecureString(); // password 要以SecureString傳入,而且一定要給password = =
foreach (char c in pw)
{
ss.AppendChar(c);
}
pro.StartInfo.Password = ss;
pro.StartInfo.UseShellExecute = false;
pro.StartInfo.UseShellExecute = false;
pro.StartInfo.FileName = "notepad.exe";
pro.Start();
2009/01/06
C# 從程式內呼叫程式,以特定使用者呼叫 Process.StartInfo
訂閱:
文章 (Atom)
-
一個糖果有一個糖果紙 一個糖果1元 現在商店在作促銷 3個糖果紙可以換1個糖果 請問 15元最多可以吃幾個糖果?
-
內容取自 Producthunt =============================== "What's a tool that changed your life?" - us to freelancers on Twitt...
-
## Use appcmd ### List application pool (find the apppool name) ``` C:\Windows\System32\inetsrv\appcmd.exe list apppool ==== the result ==...