C#Process.Start()不启动控制台应用程序

时间:2014-06-03 14:02:52

标签: c# console-application

我正在尝试让C#控制台应用程序现在从使用PS3 Eyes的不同C#程序执行。有各种Key.X命令来执行某些代码字符串,而我遇到一个特定的位 - Process.Start()方法有问题。

//Take a snapshot from left camera and save to current directory as "snapshot.png"
       case Key.Z:
int left = camLeft.Device.LensCorrection1;
camLeft.Device.LensCorrection1 = 0;
Thread.Sleep(150);
BitmapSource bmpSource = camLeft.Device.BitmapSource as BitmapSource;
MemoryStream ms = new MemoryStream();
BitmapEncoder encoder = new PngBitmapEncoder();
encoder.Frames.Add(BitmapFrame.Create(bmpSource));
encoder.Save(ms);
ms.Seek(0, SeekOrigin.Begin);                            
System.Drawing.Bitmap bitmap = new System.Drawing.Bitmap(ms);
string filepath = Environment.CurrentDirectory;
string fileName = System.IO.Path.Combine(filepath, @"snapshot.png");
bitmap.Save(fileName, ImageFormat.Png);
bitmap.Dispose();
camLeft.Device.LensCorrection1 = left;

//Start other C# program that automatically uploads the image to a specified URL
Process.Start("Explicit file path here");

快照代码有效;它需要一张照片,但Process.Start似乎没有执行我为将图像上传到URL而创建的其他控制台应用程序。该代码经过测试并证明可行,但如果有必要,我也可以在此处发布。有什么想法吗?

0 个答案:

没有答案