title: Pass data from c# to electron
body: <p>I am loading electron from c# via process object. I want to pass data from c# to electron(nodejs) via process object(Inter process communication). </p>
  
  <p>I have passed data in C# via standard input. But i am unable to get the data in node via standard output.</p>
  
  <p>C# code to load electron and passing data via standard input.</p>
  
  <pre class="lang-cs prettyprint-override"><code>var process = new System.Diagnostics.Process();
  var startInfo = new System.Diagnostics.ProcessStartInfo
  {
      WorkingDirectory = @"desktopApp",
      WindowStyle = System.Diagnostics.ProcessWindowStyle.Normal,
      FileName = @"electron.exe",
      RedirectStandardInput = true,
      UseShellExecute = false,
      //CreateNoWindow = true,
      Arguments = "app"
  };
  
  process.StartInfo = startInfo;
  process.Start();
  
  StreamWriter myStreamWriter = process.StandardInput;
  myStreamWriter.WriteLine("jsonData\n"); //Data string passing
  myStreamWriter.Close();
  process.WaitForExit(); 
  </code></pre>
  
  <p>Electron main.js to get the data. Below event is not triggering at all.</p>
  
  <pre><code>process.stdout.on('data', (jsonData) =&gt; {
      console.log("data", jsonData);
  });
  </code></pre>