Wednesday, 21 August 2013

Cannot run exe file from wpf application

Cannot run exe file from wpf application

..and I have no idea why. I can run exe output file from debug folder
(application created in wpf), but I cant run file I need to send products
into ethernet connected weight. This exe file reads .plu file (product by
product) and adding them into weight memory.
Code im using:
using (StreamWriter sw = new StreamWriter(appPath + "\\Wagi\\" +
cbi.Content.ToString() + "\\Kasa1.plu"))
{
sw.WriteLine("[MT_STAND_FIRE,PLU,WRITE,0,0,0,0]");
foreach (DataRowView item in prodDG.Items)
{
//write lines about products
}
sw.WriteLine("[MT_STAND_FIRE,Extra Text,WRITE,0,0,0,0]");
sw.WriteLine("[MT_STAND_FIRE,Preset Key,Write,0,0,0,0]");
}
string ExecutableFilePath = appPath + @"\Wagi\" +
cbi.Content.ToString() + @"\bComScale.exe";
if (File.Exists(ExecutableFilePath))
{
Process.Start(ExecutableFilePath);
}
Any ideas?

No comments:

Post a Comment