我将在我的自定义c#表单中预编译一个asp.net应用程序。我如何检索流程日志并检查它是否成功?如何从Process.Start获取日志
这里是我的代码
string msPath = "c:\\WINDOWS\\Microsoft.NET\\Framework\\v2.0.50727\\";
string msCompiler = "aspnet_compiler.exe";
string fullCompilerPath = Path.Combine(msPath, msCompiler);
msPath.ThrowIfDirectoryMissing();
fullCompilerPath.ThrowIfFileIsMissing();
ProcessStartInfo process = new ProcessStartInfo
{
CreateNoWindow = false,
UseShellExecute = false,
WorkingDirectory = msPath,
FileName = msCompiler,
Arguments = "-p {0} -v/{1}"
.StrFormat(
CurrentSetting.CodeSource,
CurrentSetting.CompileTarget)
};
Process.Start(process);
谢谢!
ProcessStartInfo类没有称为Start()和StandardOutput()的方法? – 2010-07-21 05:59:14
@Martin Ongtangco - 不,它不。 '进程'。看到这里:http://msdn.microsoft.com/en-us/library/system.diagnostics.processstartinfo_methods.aspx – Oded 2010-07-21 06:15:01
嗨,我得到这个错误,但没有细节,以帮助我... “该系统找不到指定的文件“ – 2010-07-21 06:26:57