System.CodeDom.Compiler.Executor.ExecWaitWithCapture C# (CSharp) Method

ExecWaitWithCapture() public static method

public static ExecWaitWithCapture ( IntPtr userToken, string cmd, TempFileCollection tempFiles, string &outputName, string &errorName ) : int
userToken System.IntPtr
cmd string
tempFiles TempFileCollection
outputName string
errorName string
return int
        public static int ExecWaitWithCapture(IntPtr userToken, string cmd, TempFileCollection tempFiles, ref string outputName, ref string errorName) {
            return ExecWaitWithCapture(new SafeUserTokenHandle(userToken, false), cmd, Environment.CurrentDirectory, tempFiles, ref outputName, ref errorName, null);
        }

Same methods

Executor::ExecWaitWithCapture ( IntPtr userToken, string cmd, string currentDir, TempFileCollection tempFiles, string &outputName, string &errorName ) : int
Executor::ExecWaitWithCapture ( SafeUserTokenHandle userToken, string cmd, string currentDir, TempFileCollection tempFiles, string &outputName, string &errorName, string trueCmdLine ) : int
Executor::ExecWaitWithCapture ( string cmd, TempFileCollection tempFiles, string &outputName, string &errorName ) : int
Executor::ExecWaitWithCapture ( string cmd, string currentDir, TempFileCollection tempFiles, string &outputName, string &errorName ) : int

Usage Example

示例#1
0
        internal void Compile(CompilerParameters options, string compilerDirectory, string compilerExe, string arguments, ref string outputFile, ref int nativeReturnValue, string trueArgs)
        {
            string errorName = null;

            outputFile = options.TempFiles.AddExtension("out");
            string path = Path.Combine(compilerDirectory, compilerExe);

            if (!File.Exists(path))
            {
                throw new InvalidOperationException(SR.GetString("CompilerNotFound", new object[] { path }));
            }
            string trueCmdLine = null;

            if (trueArgs != null)
            {
                trueCmdLine = "\"" + path + "\" " + trueArgs;
            }
            nativeReturnValue = Executor.ExecWaitWithCapture(options.SafeUserToken, "\"" + path + "\" " + arguments, Environment.CurrentDirectory, options.TempFiles, ref outputFile, ref errorName, trueCmdLine);
        }
All Usage Examples Of System.CodeDom.Compiler.Executor::ExecWaitWithCapture