private static int OSExecute(LinyeeState L) { #if XBOX || SILVERLIGHT LinyeeLError(L, "os_execute not supported on XBox360"); #else CharPtr param = LinyeeLOptString(L, 1, null); if (param == null) { LinyeePushInteger(L, 1); return(1); } CharPtr strCmdLine = "/C " + LinyeeLOptString(L, 1, null); System.Diagnostics.Process proc = new System.Diagnostics.Process(); proc.EnableRaisingEvents = false; proc.StartInfo.FileName = "CMD.exe"; proc.StartInfo.Arguments = strCmdLine.ToString(); proc.StartInfo.CreateNoWindow = true; proc.Start(); proc.WaitForExit(); LinyeePushInteger(L, proc.ExitCode); #endif return(1); }
public override string ToString() { return(str.ToString()); } // for debugging