Asp.net執行服務器端的可執行文件
當前位置:點晴教程→知識管理交流
→『 技術文檔交流 』
方法一、process
In order to execute exp.exe of Oracle, IIS must has powerful previlege. In Web.Config, identity node must be added. <identity impersonate="true" userName="Administrator" password="passwd" /> In machine.config, the processModel node’s userName attribute should be changed to SYSTEM.
方法二、ASPEXEC組件法 ASPEXEC ASPEXEC是一個免費的ASP組件,它可以執行Server端DOS與Windows的應用程序。 ASPEXEC 3.0語法使用說明: 1.使用ASPEXEC之前,請先注冊ASPEXEC.DLL這一個組件,其注冊語法如下: Regsvr32 ASPEXEC.DLL 2.語法說明 Set Executor = Server.CreateObject("ASPExec.Execute") '這是建立組件的語法 Application '這是執行的應用程序的檔名稱與路徑 Executor.Application = "notepad.exe" Parameters '這是執行的應用程序的參數 Executor.Parameters = "c:\autoexec.bat" TimeOut '這是執行應用程序的等待時間(ms) Executor.TimeOut = "6000" ShowWindow '這是執行的應用程式時是否要顯示視窗 Executor.ShowWindow = Ture ExecuteDosApp 'Executes the specified app as a DOS app and returns stdio as string Executor.ExecuteDosApp ExecuteWinAppAndWait 'Execute the specified app as a Windows app and wait for the specified timeout if exec is successful ExecuteWinApp 'Execute the specified app as a Windows app and return result code immediately 3.范例 Set Executor = Server.CreateObject("ASPExec.Execute")
Executor.Application = "notepad.exe" Executor.Parameters = "c:\autoexec.bat" Executor.ShowWindow = True Response.Write "Attempting to execute " & Executor.Application & "<br>" strResult = Executor.ExecuteWinApp Response.Write "The result of this call was: " & strResult 該文章在 2011/4/22 14:49:12 編輯過 |
關鍵字查詢
相關文章
正在查詢... |