Asp.net執(zhí)行服務(wù)器端的可執(zhí)行文件
當(dāng)前位置:點(diǎn)晴教程→知識(shí)管理交流
→『 技術(shù)文檔交流 』
方法一、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是一個(gè)免費(fèi)的ASP組件,它可以執(zhí)行Server端DOS與Windows的應(yīng)用程序。 ASPEXEC 3.0語(yǔ)法使用說(shuō)明: 1.使用ASPEXEC之前,請(qǐng)先注冊(cè)ASPEXEC.DLL這一個(gè)組件,其注冊(cè)語(yǔ)法如下: Regsvr32 ASPEXEC.DLL 2.語(yǔ)法說(shuō)明 Set Executor = Server.CreateObject("ASPExec.Execute") '這是建立組件的語(yǔ)法 Application '這是執(zhí)行的應(yīng)用程序的檔名稱與路徑 Executor.Application = "notepad.exe" Parameters '這是執(zhí)行的應(yīng)用程序的參數(shù) Executor.Parameters = "c:\autoexec.bat" TimeOut '這是執(zhí)行應(yīng)用程序的等待時(shí)間(ms) Executor.TimeOut = "6000" ShowWindow '這是執(zhí)行的應(yīng)用程式時(shí)是否要顯示視窗 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 編輯過(guò) |
關(guān)鍵字查詢
相關(guān)文章
正在查詢... |