Dear All,
请教:如何在*.aspx页面中实现:
(1)点击Button时,执行自己的Test.exe程序?
(2)点击URL超链接时,执行自己的Test.exe程序?
Note:使用Java或者C#,需要直接写在*.aspx页面里的那种;
Thanks a million.
请教:如何在*.aspx页面中实现:
(1)点击Button时,执行自己的Test.exe程序?
(2)点击URL超链接时,执行自己的Test.exe程序?
Note:使用Java或者C#,需要直接写在*.aspx页面里的那种;
Thanks a million.
解决方案 »
- Microsoft.Web.Administration如何删除IIS站点的默认文档
- 数据库表字段自动加一 奉100分以致谢高手,表达敬意
- iframe的问题
- 如何在客户端执行DLL?
- 框架问题
- 自己定义控件,嵌入工程根目录一下的一个JS文件,在命令编译的时候出错,请高手帮忙。
- 必须先登录才能进入其他页面???
- 正则表达式:只允许输入4-15位任意字符
- 菜鸟提问,关于eval。多多捧场,感激不尽!!
- 急求SaveFileDialog.ShowDialog()的菜鸟问题,高手请进!
- 怎么样远端图片http://www.163.com/images/1.gif给下载在本地
- 那位能够实现Server.Transfer相同的功能,但要求能跨域名
是的.*.aspx和Test.exe都是位于Server上的,不需要在Client上执行:)
非常感谢您的回复!不知道这个能够直接嵌入到*.aspx页面里面吗?
To:jiezhi(風依舊)
请问在服务器端执行,如何实现呢?
Thanks in advance.
有没有小例子啊?
多谢了!
AppDomain otherDomain = AppDomain.CreateDomain("otherDomain");
currentDomain.ExecuteAssembly("MyExecutable.exe");
using System.Diagnostics;
using System.IO;namespace DeComplieCHM
{
/// <summary>
/// Class1 的摘要说明。
/// </summary>
public class Class1
{
private string _dirction=null;
private string _chmname=null;
public Class1(string dictory,string chmname)
{
//
// TODO: 在此处添加构造函数逻辑
//
this._dirction=dictory;
this._chmname=chmname;
}
public string Dirction
{
set{_dirction =value;}
get{return _dirction;}
}
public string CHMName
{
set{_chmname =value;}
get{return _chmname;}
}
public bool decompilechm()
{
if(CHMName ==""||Dirction=="")
return false;
Process p=new Process();
p.StartInfo.FileName="cmd.exe";
p.StartInfo.RedirectStandardInput=true;
p.StartInfo.RedirectStandardOutput=true;
p.StartInfo.CreateNoWindow=true;
p.StartInfo.UseShellExecute=false;
p.Start();
StreamWriter sw=p.StandardInput;
sw.WriteLine("hh.exe -decompile "+Dirction+" "+CHMName);
sw.WriteLine("exit");
sw.Close();
p.Close();
return true;
}
}
}
您写的那部分代码还需要Import什么Namespace?
另外您是如何查到这个帮助的?请将查找的步骤/链接告诉我好吗?
非常感谢!
To:wj2929
谢谢您的参考代码,我现在是要直接将C#/Java代码嵌入*.aspx页面之中:)
//调用osql执行脚本System.Diagnostics.Process sqlProcess =new System.Diagnostics.Process();sqlProcess.StartInfo.FileName = "osql.exe ";sqlProcess.StartInfo.Arguments = string.Format(" -U {0} -P {1} -d {2} -i {3} PlanControl2005.txt", this.Context.Parameters["user"].ToString(),this.Context.Parameters["pwd"].ToString(), this.Context.Parameters["dbname"].ToString(), this.Context.Parameters["targetdir"].ToString());sqlProcess.StartInfo.WindowStyle=System.Diagnostics.ProcessWindowStyle.Hidden;sqlProcess.Start();sqlProcess.WaitForExit() ;//等待执行sqlProcess.Close();