C# command-line argument with newline fails in C# but not in python. Need to make the c# work
<p>Env: .NET 3.5 Visual Studio 2008 SP1, on Win XP SP3, Python 2.7. Corporate image, no admin rights.</p>

<p>In C# 3.5, I want to pass a parameter to a command-line program, and this parameter contains newlines. It works in Python 2.7 but not in C#.</p>

<p>When body contains newline, c# truncates the result, but python passes it correctly.</p>

<p>Python code</p>

<pre><code>cmd = self.app_path + ' email -Subject "' + subject + '" -From "' + address_from + '" -To "' + address_to +'" -Body "' + body +'"'
cmd_result = subprocess.Popen(cmd, stdout=subprocess.PIPE).communicate()
</code></pre>

<p>C# code:</p>

<pre><code>string Command = "&lt;path to executable&gt;";                 
string arguments = "  email -From " + FromAddress + " -To " + ToAddress + " -Subject \"" + SubjectLine + "\" -Body \"" + emailBody + "\" ";
System.Diagnostics.ProcessStartInfo start = new System.Diagnostics.ProcessStartInfo(Command, arguments);
start.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
start.CreateNoWindow = false;
start.UseShellExecute = true;
System.Diagnostics.Process process = System.Diagnostics.Process.Start(start);
</code></pre>

<p>Any idea?</p>

<p>Update: body in the python example and emailBody in the c# example contain the same string, as strings are represented in each language.</p>

<p>Update: noticed the command wasn't terminated correctly in the python code. I added + '"' at the end of line 2. The code ran as before.</p>

<p>Also, as you can tell, the app called sends the body (emailBody) parameter content as an email body.</p>
