الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

#exec Jar File In C

بدأه Creative_R في 7 مارس 2008 · 3 رد · 797 مشاهدة · في Microsoft Visual C#.NET
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

alasalmo alikum

i'm facing a problem in opening jar file(by execute batch file which contains java -jar command) in c#

here is the code:

string filepath = Server.MapPath("test.bat");


		ProcessStartInfo psi = new ProcessStartInfo("cmd.exe");
		psi.UseShellExecute = false;
		psi.RedirectStandardOutput = true;
		psi.RedirectStandardInput = true;
		psi.RedirectStandardError = true;


		Process proc = Process.Start(psi);
		StreamReader sr = File.OpenText(filepath);
		StreamWriter sw = proc.StandardInput;
		StreamReader sre = proc.StandardError;

		while (sr.Peek() != -1)
		{

			sw.WriteLine(sr.ReadLine() + Environment.NewLine);
		}

		TextBox1.Text = sre.ReadLine();
		sr.Close();
		proc.Close();
		sw.Close();

the following message appears

Unable to access jarfile  *.jar

what do you think the problem is ???

مواضيع مشابهة