C#代码 谢谢

来源:百度知道 编辑:UC知道 时间:2024/05/16 15:55:06
int min = 0;
int count = 0;
count=int.Parse(txtCount.Text);
min = count / 60;
System.Diagnostics.Process.Start("c:\\windows\\system32\\shutdown.exe", @"-s -t {0}", min);
_________________________________________________________________
System.Diagnostics.Process.Start("c:\\windows\\system32\\shutdown.exe", @"-s -t {0}", min);这里不能{0}这样写 该 怎么办?

什么能不能,如果提供这种方法了,当然就可以了。
楼主所说的不能,估计是没有提供像楼主的这种3个参数的方法。
能不能把这个 @"-s -t {0}", min也当做一个变量呢,你的意思不就是
string str="-s -t {0}"+min;
那str就是你要的变量了。

这好像是一个定时关机的代码吧。