I want to reuse code from my Windows Forms App to my Window store app.
If I replace it and compile it, it gives compile time errors and I'm unable to find a way to fix it.
private void Text_Click(object sender, RoutedEventArgs e)
{
var processinfo = new ProcessStartInfo();
String arg ="\"C:\\Users\\chnpn\\Documents\\NetBeansProjects\\PartyDemo\\dist\\PartyDemo.jar\"";
String path ="C:\\Users\\chnpn\\Documents\\NetBeansProjects\\PartyDemo\\newtest.wav";
//processinfo.FileName = "C:\\FFMPEG\\bin\\ffmpeg.exe";
//processinfo.Arguments = "-i 360.mp4 -vn -y 360_1.wma";
processinfo.FileName = "C:\\ProgramData\\Oracle\\Java\\javapath\\java.exe";
processinfo.Arguments = "-jar " + arg + " \"" + path + "\"";
//processinfo.Arguments = "-jar " + arg;
processinfo.RedirectStandardOutput = true;
processinfo.RedirectStandardError = true;
processinfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
processinfo.UseShellExecute = false;
processinfo.LoadUserProfile = true;
processinfo.CreateNoWindow = true;
//processinfo.EnvironmentVariables.Add("HOME", @"C:\Users\napatsawan\.ffmpeg");
Process process = Process.Start(processinfo);
process.OutputDataReceived += new DataReceivedEventHandler(setOutput);
process.BeginOutputReadLine();
process.Start();
process.WaitForExit();
// We may not have received all the events yet!
Thread.Sleep(5000);
// Console.ReadLine();
}
It shows errors for the following
ProcessStartInfo
ProcessWindowStyle
Process
DataReceivedEventHandler(setOutput)