TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Antonio Rodriguez Cabra
NA
1
0
System process to capture java application
Jun 9 2012 2:48 AM
hello, i have a problem im creating an application that runs a java.class code using the system process a can actually compile and run the code using javac.exe and java.exe the problem is that i have a code that ask the user for an input, the message actually shows in the textbox using the redirectstardardoutput but then it crashes when ask for the input. heres the code. thanks
private void LaunchProcess(string class)
{
string app = varGlob.JAVADIR + "java.exe ";
string ex1 = "\"" + class+ "\"";
build.StartInfo.WorkingDirectory = varGlob.JAVADIR;
build.StartInfo.Arguments = ex1;
build.StartInfo.FileName = app;
build.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
build.StartInfo.UseShellExecute = false;
build.StartInfo.RedirectStandardOutput = true;
build.StartInfo.RedirectStandardInput = true;
build.StartInfo.RedirectStandardError = true;
build.StartInfo.CreateNoWindow = false;
build.ErrorDataReceived += build_ErrorDataReceived;
build.OutputDataReceived += build_ErrorDataReceived;
build.EnableRaisingEvents = true;
//build.Exited += build_Exited;
build.Start();
build.BeginOutputReadLine();
build.BeginErrorReadLine();
// build.StandardInput.WriteLine("5");
build.WaitForExit();
cmp.TME.error(str, 0);
cmp.TME.error("", 0);
cmp.TME.error("output generated.", 0);
}
void build_ErrorDataReceived(object sender, DataReceivedEventArgs e)
{
string strMessage = e.Data;
str += strMessage;
}
Reply
Answers (
0
)
C# Printing Pre-designed bill/invoice
I want list file directory in treeview control with checkboxes .Tnen perform delete function to delete selectef file or folder in c sharp