System.Diagnostics.Process.Start(@"C:\Program Files\Adobe\Reader 9.0\Reader\AcroRd32.exe")
從計時器執行時不起作用Windows服務的事件?System.Diagnostics.Process.Start()
-1
A
回答
3
此代碼可能會幫助您System.Diagnostics.Process.Start Class
using System;
using System.Diagnostics;
using System.ComponentModel;
namespace MyProcessSample
{
class MyProcess
{
public static void Main()
{
Process myProcess = new Process();
try
{
myProcess.StartInfo.UseShellExecute = false;
// You can start any process, HelloWorld is a do-nothing example.
myProcess.StartInfo.FileName = "C:\\HelloWorld.exe";
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.
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
}
}
}
2
的Windows服務的用戶的交互式會話之外運行的,所以雖然在執行過程中是可能的,你不應該期待一個新窗口中打開(在你的情況下, acrobat reader的實例)。
此外,基於運行服務的用戶,您經常會對您可以或不可以執行的操作有安全限制。
+0
我開始以下錯誤:應用程序未能正確初始化(0xc0000142) – 2010-12-22 09:59:52
0
相關問題
- 1. System.diagnostics.process.start -System.ComponentModel.Win32Exception
- 2. System.Diagnostics.Process.Start問題
- 3. C#System.Diagnostics.Process.Start Cmd Jarsigner
- 4. C#System.Diagnostics.Process.Start()參數
- 5. System.Diagnostics.Process.Start()的替代選擇
- 6. 傳遞文件流到System.Diagnostics.Process.Start
- 7. 使用System.Diagnostics.Process.Start啓動服務
- 8. System.Diagnostics.Process.Start()奇怪的行爲
- 9. System.Diagnostics.Process.Start在Default.aspx.cs中不起作用
- 10. System.Diagnostics.Process.Start C#身份驗證問題
- 11. System.Diagnostics.Process.Start()打開/運行錯誤的目錄?
- 12. Windows Server 2008上的System.Diagnostics.Process.Start()問題
- 13. 爲什麼我的System.Diagnostics.Process.Start不能工作?
- 14. C#執行EXE不使用System.Diagnostics.Process.Start
- 15. System.Diagnostics.Process.Start針對不同域的進程
- 16. 類似於System.Diagnostics.Process.Start來運行流
- 17. 取消通過System.Diagnostics.Process.Start()啓動的進程
- 18. System.Diagnostics.Process.Start()在Windows CE上返回FileNotFound異常
- 19. 如何等待,直到System.Diagnostics.Process.Start完成
- 20. System.Diagnostics.Process.Start在服務器上拋出threadbort異常
- 21. System.Diagnostics.Process.Start(「Notepad.exe」);不在現場服務器上工作
- 22. System.Diagnostics.Process.Start(「Shutdown」,「-s」)在Visual Basic中不起作用
- 23. System.Diagnostics.Process.Start with WindowStyle.Hidden不會重新執行句柄
- 24. 從System.Diagnostics.Process.Start()方法啓動的進程訪問註冊表項
- 25. System.Diagnostics.Process.Start不使用IIS,ASP.NET,但開發服務器上
- 26. System.Diagnostics.Process.Start問題「無法找到特定文件」
- 27. System.Diagnostics.Process.Start for mailto無法在測試服務器上工作
- 28. C#4.0:有沒有一種方法來檢查,如果在System.Diagnostics.Process.Start
- 29. System.Diagnostics.Process.Start()從Windows服務調用時無法啓動進程
- 30. 使用System.Diagnostics.Process.Start運行程序會導致MissingMethodException
也許你想詳細說明它是如何「不起作用」的。例如。是拋出的異常? – Reddog 2010-12-22 09:52:03