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 编辑过 |
关键字查询
相关文章
正在查询... |