问题描述
我尝试在进程启动时运行我的win表单的.exe文件但是无法看到window.my进程在我检查任务管理器时启动并运行。问题仅在于显示表单。
我尝试了什么:
{
string FilePath = Path。合并(AppDomain.CurrentDomain.BaseDirectory,WinForm.exe);
System.Diagnostics.Process myProcess = new System.Diagnostics.Process();
myProcess.StartInfo .FileName = FilePath;
myProcess.StartInfo.CreateNoWindow = false;
myProcess.StartInfo.WindowStyle = ProcessWindowStyle.Normal;
try
{
myProcess.Start();
}
catch(exception ex)
{
wr.WriteLine(Process Starts ??+ ex.ToString());
}
myProcess.WaitForExit();
}
i tried to run .exe file of my win form when process starts but unable to see window.my process starts and running when i checked task manager.the problem is only in showing form.
What I have tried:
{
string FilePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory,"WinForm.exe");
System.Diagnostics.Process myProcess = new System.Diagnostics.Process();
myProcess.StartInfo.FileName = FilePath;
myProcess.StartInfo.CreateNoWindow = false;
myProcess.StartInfo.WindowStyle = ProcessWindowStyle.Normal;
try
{
myProcess.Start();
}
catch (Exception ex)
{
wr.WriteLine("Process Starts??" + ex.ToString());
}
myProcess.WaitForExit();
}
推荐答案
这篇关于我怎么从windows service看到windows窗体。我可以吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!