asp.net 调用本地程序 调用执行exe应用程序
来源:互联网 发布:软件在线升级 编辑:程序博客网 时间:2024/05/18 03:13
asp.net 调用本地程序 调用执行exe应用程序
在asp.net中执行应用程序有两种方法,面分别用这两种方法执行Windows中的记事本程序notepad.exe:
1、调用win32函数ShellExecute。
调用win32函数ShellExecute。
添加引用Imports System.Runtime.InteropServices
声明函数:
<DllImport("shell32.dll")> _
Private Shared Function ShellExecute(hwnd As IntPtr, lpOperation As String, lpFile As String, lpParameters As String, lpDirectory As String, nShowCmd As Int32) As IntPtr
End Function
调用:
ShellExecute(IntPtr.Zero, "open", "c:/windows/notepad.exe", Nothing, Nothing, 1)
2、用.NET Framework中的Process类。
添加引用
Imports System.Diagnostics
调用:
Dim process As New Process()process.StartInfo.FileName = "c:/windows/notepad.exe" '注意文件名必须加后缀。 process.Start()
=============================================
注意:在asp.net2.0中运行以上两种方法写的程序都可以得到想要的结果。但是在asp.net1.1或更早的版本却不能得到想要的结果
============================================
这是微软为了安全原因禁掉了程序的运行,你需要做以下两步才能正常运行:
1、在桌面右键单击:我的电脑--管理--服务和应用程序--服务--IIS Admin--属性--登陆--本地系统帐户-选“允许与桌面交互”--确定
重新启动“IIS Admin”服务。
2、打开目录“C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/CONFIG”中的machine.config文件,
找到“processModel”项,原来这项中有一个属性是userName="machine",将machine改为“system”,保存文件。
- asp.net 调用本地程序 调用执行exe应用程序
- ASP.NET中调用EXE程序
- asp.net调用外部exe程序
- js调用本地exe执行
- vb.net 调用本地exe
- Air调用本地exe程序
- C++调用本地exe程序
- c# asp.net 调用(打开).exe应用程序
- 调用exe程序的执行
- asp.net调用cmd.exe
- asp.net 调用exe文件
- 黑客程序(asp.net网页调用exe程序) 2013
- asp.net中执行exe应用程序2008-07-03 15:53在asp.net中执行应用程序有两种方法:1、调用win32函数ShellExecute。2、用.NET Framework中的Process类。下面我分别用这两种方法执行Windows中的
- asp.net中执行exe应用程序
- asp.net中执行exe应用程序
- asp.net中执行exe应用程序
- ASP怎么在服务器端调用exe应用程序
- asp.net 调用外部应用程序
- flex4的新数据类型ArrayList
- 基于Linux系统调用使用php实现一个在线编译运行C语言程序的系统
- ORACLE笔记
- mysqli.dll和mysql.dll以及fetch_row和fetch_array的区别
- 软件工程之——各个阶段的基本任务和结束标准
- asp.net 调用本地程序 调用执行exe应用程序
- 进行时
- Win32注册表编辑类
- 名词
- Linux基础: 解密module_init幕后的故事
- VB.NET回车/换行组合符
- 记录下最近的一些事情
- Some Tips In Object C
- restrict关键字用法