开发者

how start many process(own program) when process is singleton in C#

开发者 https://www.devze.com 2023-02-09 03:31 出处:网络
i have loop andin loop my program spawn new process and new process is singletonso other process cant start

i have loop and in loop my program spawn new process and new process is singleton so other process cant start

foreach (var i in files)
{
    System.Diagnostics.P开发者_如何学JAVArocess.Start("c:\\Telock\\Telock.exe", " -S" + i.ToString());

}

how start 2 after 1 finish and ...


Why don't you look up Process class in MSDN (after all, you ARE using it)? If you had done that, you would have found the WaitForExit method.

foreach (var filename in files)
{
    Process.Start("c:\\Telock\\Telock.exe", " -S" + filename.ToString()).WaitForExit();
}

Take for habit to use more descriptive variable names (i doesn't really say anything, especially not for a filename).

0

精彩评论

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