开发者

C#|Working with process help [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its curren开发者_开发技巧t form. For help clarifying this question so that it can be reopened, visit the help center. Closed 11 years ago.

a few days ago i started working with process, i did a few things.. and wanted to ask a question.

lets say i got a process :

process = Process.Start("D:\\Server1\\orangebox\\srcds.exe", "srcds.exe -console -game cstrike  +maxplayers 16 -port 27017 +map de_dust2");
            process.EnableRaisingEvents = true;

            process.Exited += new EventHandler(process_Exited);
        }

        void process_Exited(object sender, EventArgs e)
        {
            process = Process.Start("D:\\Server1\\orangebox\\srcds.exe", "srcds.exe -console -game cstrike  +maxplayers 16 -port 27017 +map de_dust2");
            process.EnableRaisingEvents = true;

            process.Exited += new EventHandler(process_Exited);

so, its works perfect. but, how can i do new process? but. added them from a button and the info of them comes from a textbox.

lets say i got button1 and 3 textbox. 1 of the textboxs give me the process name, 1 the args, and 1 if to run now ot not.

so how can i do that?

thanks!!


Use ProcessStartInfo class to specify an arguments and assign it to relative property of your Process class.

http://msdn.microsoft.com/en-us/library/system.diagnostics.processstartinfo(v=vs.71).aspx

If you don't want process run now, initialize it but don't call Run() NOW.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜