簡體   English   中英

C# 中表格的程序執行 + 參數

[英]Program Execution + Parameters from a form in C#

我目前正在嘗試使用 C# 形式的參數執行程序。 我的代碼:

    private void button1_Click_1(object sender, EventArgs e)
    {
        Process.Start("nan.exe");

    }

雖然我試圖傳遞這個參數:“nan.exe C:\Windows\System32”

在我的情況下,我怎么能這樣做?

利用:

 Process.Start("nan.exe", @"c:\windows\system32");

建議使用 Environment.GetFolderPath()。

您可以使用StartInfo object 為您執行此操作:

// where fileName and arguments is what you need:
Process p = new Process();
p.StartInfo = new ProcessStartInfo(@"nan.exe", @"C:\windows\system32");
p.Start();

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM