希望C#程序启动WPF应用程序

Bob*_* T. 1 c# wpf

我发现需要从ac#program中启动一个WPF应用程序.我编写了一个名为eBrowse的简单WPF浏览器作为练习.然后,我被要求将它添加到已经在使用的ac#程序中.

我试过System.Diagnostics.Process.Start(@"C:\eBrowse");但它没用.

在网站上发现的另一种可能性:

myProcess.StartInfo.UseShellExecute = true;
// You can start any process, HelloWorld is a do-nothing example.
//myProcess.StartInfo.FileName = "C:\\HelloWorld.exe";
myProcess.StartInfo.FileName = @"C:\eBrowse";
myProcess.StartInfo.CreateNoWindow = true;
myProcess.Start();
// This code assumes the process you are starting will terminate itself. 
// Given that is is started without a window so you cannot terminate it 
// on the desktop, it must terminate itself or you can do it programmatically
// from this application using the Kill method.
Run Code Online (Sandbox Code Playgroud)

我想知道是否可能无法从c#启动WPF应用程序.任何想法都会很棒.

Lav*_*Lav 5

我想你没有指定你的EXE名称.试试以下:

myProcess.StartInfo.FileName = @"C:\eBrowse\yourEXeName.exe"; 
Run Code Online (Sandbox Code Playgroud)