当前位置:编程学习 > C#/ASP.NET >>

新手請教下運行外部程式

有一個bat 內容是start 123.exe 127.0.0.1 4545 , 是運行123.exe 去指定的ip 和端口\

如何用c#是如何表達呢? 

我知道以下代碼是可以運行123.exe , 但如何加入指定的ip和端口呢??
public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            Process game= new Process();
            // FileName 是要執行的檔案
            game.StartInfo.FileName = "123.exe";
            game.Start();
        }
    }
--------------------编程问答-------------------- game.StartInfo.Arguments = "127.0.0.1 4545"; --------------------编程问答--------------------

            Process p = new Process();
            p.StartInfo.FileName = "123.exe";
            p.StartInfo.Arguments = "127.0.0.1 4545";
            p.Start();
补充:.NET技术 ,  C#
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,