ShellExec不必在.net中使用了,已经用Process.Start代替了。这是删除文件的代码。 Process DOS = null; ProcessStartInfo qOptions = new ProcessStartInfo("cmd", "/C del *.doc"); qOptions.UseShellExecute = true; qOptions.WindowStyle = ProcessWindowStyle.Hidden; DOS = Process.Start(qOptions); DOS.WaitForExit();
ProcessStartInfo qOptions = new ProcessStartInfo("cmd", "/C del *.doc");
qOptions.UseShellExecute = true;
qOptions.WindowStyle = ProcessWindowStyle.Hidden; DOS = Process.Start(qOptions);
DOS.WaitForExit();