LOGO OA教程 ERP教程 模切知识交流 PMS教程 CRM教程 开发文档 其他文档  
 
网站管理员

Asp.net执行服务器端的可执行文件

admin
2011年4月22日 14:49 本文热度 2758

方法一、process

string user = "sde";
string user1= "sys";
string pwd1 = "sys";
string pwd = "sde";
string db = "wbz";
string dir = @"c:\wbz1";
string cmd =@"/c exp "+user+"/"+pwd+"@"+db+" owner="+user+" file="+dir+".dmp";
Process myprocess=Process.Start("cmd", cmd);
myprocess.WaitForExit();
myprocess.Exited +=new EventHandler(myprocess_Exited);

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.

<processModel userName="SYSTEM" password="AutoGenerate" />

 

方法二、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 编辑过
关键字查询
相关文章
正在查询...
点晴ERP是一款针对中小制造业的专业生产管理软件系统,系统成熟度和易用性得到了国内大量中小企业的青睐。
点晴PMS码头管理系统主要针对港口码头集装箱与散货日常运作、调度、堆场、车队、财务费用、相关报表等业务管理,结合码头的业务特点,围绕调度、堆场作业而开发的。集技术的先进性、管理的有效性于一体,是物流码头及其他港口类企业的高效ERP管理信息系统。
点晴WMS仓储管理系统提供了货物产品管理,销售管理,采购管理,仓储管理,仓库管理,保质期管理,货位管理,库位管理,生产管理,WMS管理系统,标签打印,条形码,二维码管理,批号管理软件。
点晴免费OA是一款软件和通用服务都免费,不限功能、不限时间、不限用户的免费OA协同办公管理系统。
Copyright 2010-2024 ClickSun All Rights Reserved