From: Gustavo Martin Date: Mon, 9 Jun 2014 04:56:40 +0000 (+0200) Subject: Process launcher, windows version X-Git-Url: https://git.gumartinm.name/?a=commitdiff_plain;h=8c868911575b8712e96d227cde8976d3472781dc;p=CSharpForFun%2F.git Process launcher, windows version --- diff --git a/Allgemeines/ProcessLauncher/ProcessLauncher.MonoDevelop.sln b/Allgemeines/ProcessLauncher/ProcessLauncher.MonoDevelop.sln new file mode 100644 index 0000000..fc85f8f --- /dev/null +++ b/Allgemeines/ProcessLauncher/ProcessLauncher.MonoDevelop.sln @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProcessLauncher", "ProcessLauncher\ProcessLauncher.MonoDevelop.csproj", "{8C9CE3D4-590C-49DA-A165-9B82625E4A3E}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x86 = Debug|x86 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {8C9CE3D4-590C-49DA-A165-9B82625E4A3E}.Debug|x86.ActiveCfg = Debug|x86 + {8C9CE3D4-590C-49DA-A165-9B82625E4A3E}.Debug|x86.Build.0 = Debug|x86 + {8C9CE3D4-590C-49DA-A165-9B82625E4A3E}.Release|x86.ActiveCfg = Release|x86 + {8C9CE3D4-590C-49DA-A165-9B82625E4A3E}.Release|x86.Build.0 = Release|x86 + EndGlobalSection + GlobalSection(MonoDevelopProperties) = preSolution + StartupItem = ProcessLauncher\ProcessLauncher.csproj + EndGlobalSection +EndGlobal diff --git a/Allgemeines/ProcessLauncher/ProcessLauncher.Windows8.sln b/Allgemeines/ProcessLauncher/ProcessLauncher.Windows8.sln new file mode 100644 index 0000000..da714a7 --- /dev/null +++ b/Allgemeines/ProcessLauncher/ProcessLauncher.Windows8.sln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2013 +VisualStudioVersion = 12.0.30110.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProcessLauncher", "ProcessLauncher\ProcessLauncher.Windows8.csproj", "{76B318BA-6C22-4E85-8146-A7F8AFD17398}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {76B318BA-6C22-4E85-8146-A7F8AFD17398}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {76B318BA-6C22-4E85-8146-A7F8AFD17398}.Debug|Any CPU.Build.0 = Debug|Any CPU + {76B318BA-6C22-4E85-8146-A7F8AFD17398}.Release|Any CPU.ActiveCfg = Release|Any CPU + {76B318BA-6C22-4E85-8146-A7F8AFD17398}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Allgemeines/ProcessLauncher/ProcessLauncher.sln b/Allgemeines/ProcessLauncher/ProcessLauncher.sln deleted file mode 100644 index d6dc8a6..0000000 --- a/Allgemeines/ProcessLauncher/ProcessLauncher.sln +++ /dev/null @@ -1,20 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2012 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProcessLauncher", "ProcessLauncher\ProcessLauncher.csproj", "{8C9CE3D4-590C-49DA-A165-9B82625E4A3E}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|x86 = Debug|x86 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {8C9CE3D4-590C-49DA-A165-9B82625E4A3E}.Debug|x86.ActiveCfg = Debug|x86 - {8C9CE3D4-590C-49DA-A165-9B82625E4A3E}.Debug|x86.Build.0 = Debug|x86 - {8C9CE3D4-590C-49DA-A165-9B82625E4A3E}.Release|x86.ActiveCfg = Release|x86 - {8C9CE3D4-590C-49DA-A165-9B82625E4A3E}.Release|x86.Build.0 = Release|x86 - EndGlobalSection - GlobalSection(MonoDevelopProperties) = preSolution - StartupItem = ProcessLauncher\ProcessLauncher.csproj - EndGlobalSection -EndGlobal diff --git a/Allgemeines/ProcessLauncher/ProcessLauncher/App.config b/Allgemeines/ProcessLauncher/ProcessLauncher/App.config new file mode 100644 index 0000000..9c05822 --- /dev/null +++ b/Allgemeines/ProcessLauncher/ProcessLauncher/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Allgemeines/ProcessLauncher/ProcessLauncher/LinuxWindowsProcess.cs b/Allgemeines/ProcessLauncher/ProcessLauncher/LinuxWindowsProcess.cs index 947443f..3f83771 100644 --- a/Allgemeines/ProcessLauncher/ProcessLauncher/LinuxWindowsProcess.cs +++ b/Allgemeines/ProcessLauncher/ProcessLauncher/LinuxWindowsProcess.cs @@ -40,7 +40,8 @@ namespace ProcessLauncher // Define variables shared by class methods. - StringBuilder processOutput = null; + StringBuilder processOutput = new StringBuilder(); + Process process = new Process(); process.StartInfo = startInfo; diff --git a/Allgemeines/ProcessLauncher/ProcessLauncher/ProcessLauncher.MonoDevelop.csproj b/Allgemeines/ProcessLauncher/ProcessLauncher/ProcessLauncher.MonoDevelop.csproj new file mode 100644 index 0000000..bf80cb6 --- /dev/null +++ b/Allgemeines/ProcessLauncher/ProcessLauncher/ProcessLauncher.MonoDevelop.csproj @@ -0,0 +1,47 @@ + + + + Debug + x86 + 12.0.0 + 2.0 + {8C9CE3D4-590C-49DA-A165-9B82625E4A3E} + Exe + ProcessLauncher + ProcessLauncher + Launching processes from C# + v4.5 + + + true + full + false + bin\Debug + DEBUG; + prompt + 4 + true + x86 + + + full + true + bin\Release + prompt + 4 + true + x86 + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Allgemeines/ProcessLauncher/ProcessLauncher/ProcessLauncher.Windows8.csproj b/Allgemeines/ProcessLauncher/ProcessLauncher/ProcessLauncher.Windows8.csproj new file mode 100644 index 0000000..c919a86 --- /dev/null +++ b/Allgemeines/ProcessLauncher/ProcessLauncher/ProcessLauncher.Windows8.csproj @@ -0,0 +1,92 @@ + + + + + Debug + AnyCPU + {76B318BA-6C22-4E85-8146-A7F8AFD17398} + Exe + Properties + ProcessLauncher.Windows8 + ProcessLauncher.Windows8 + v4.5.1 + 512 + true + publicar\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + + False + Microsoft .NET Framework 4.5.1 %28x86 y x64%29 + true + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 3.5 SP1 + false + + + + + \ No newline at end of file diff --git a/Allgemeines/ProcessLauncher/ProcessLauncher/ProcessLauncher.csproj b/Allgemeines/ProcessLauncher/ProcessLauncher/ProcessLauncher.csproj deleted file mode 100644 index bf80cb6..0000000 --- a/Allgemeines/ProcessLauncher/ProcessLauncher/ProcessLauncher.csproj +++ /dev/null @@ -1,47 +0,0 @@ - - - - Debug - x86 - 12.0.0 - 2.0 - {8C9CE3D4-590C-49DA-A165-9B82625E4A3E} - Exe - ProcessLauncher - ProcessLauncher - Launching processes from C# - v4.5 - - - true - full - false - bin\Debug - DEBUG; - prompt - 4 - true - x86 - - - full - true - bin\Release - prompt - 4 - true - x86 - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Allgemeines/ProcessLauncher/ProcessLauncher/Program.cs b/Allgemeines/ProcessLauncher/ProcessLauncher/Program.cs index 2d96dea..b9e6bea 100644 --- a/Allgemeines/ProcessLauncher/ProcessLauncher/Program.cs +++ b/Allgemeines/ProcessLauncher/ProcessLauncher/Program.cs @@ -8,12 +8,14 @@ namespace ProcessLauncher { LinuxWindowsProcess process = new LinuxWindowsProcess(); Console.WriteLine("Linux"); - var output = process.Test("ls", "-lah"); - Console.WriteLine("stdout: {0}", output.ToString()); + var linuxOutput = process.Test("ls", "-lah"); + Console.WriteLine("stdout: {0}", linuxOutput.ToString()); - // Console.WriteLine("Windows"); - // output = process.Test("dir", "/a"); - // Console.WriteLine("stdout: {0}", output.ToString()); + Console.WriteLine("Windows"); + var windowsOutput = process.Test("cmd.exe", "/C dir /A"); + Console.WriteLine("stdout: {0}", windowsOutput.ToString()); + + Console.ReadLine(); } } }