Dear All,
请教:如何在*.aspx页面中实现:
(1)点击Button时,执行自己的Test.exe程序?
(2)点击URL超链接时,执行自己的Test.exe程序?
Note:使用Java或者C#,需要直接写在*.aspx页面里的那种;
Thanks a million.

解决方案 »

  1.   

    多谢2位的回复!
    是的.*.aspx和Test.exe都是位于Server上的,不需要在Client上执行:)
      

  2.   

    不知道用Process.start()可不可以
      

  3.   

    To:wangxy0919
    非常感谢您的回复!不知道这个能够直接嵌入到*.aspx页面里面吗?  
    To:jiezhi(風依舊)
    请问在服务器端执行,如何实现呢?
    Thanks in advance.
      

  4.   

    可以直接嵌入asp.net页面,就是微软一直鼓吹的智能客户端
      

  5.   

    To:leisang(我自飘零)
    有没有小例子啊?
    多谢了!
      

  6.   

    AppDomain currentDomain = AppDomain.CurrentDomain;
          AppDomain otherDomain = AppDomain.CreateDomain("otherDomain");
          currentDomain.ExecuteAssembly("MyExecutable.exe");
      

  7.   

    参考 using System;
    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;
    }
    }
    }
      

  8.   

    To:haoco(程序员)
    您写的那部分代码还需要Import什么Namespace?
    另外您是如何查到这个帮助的?请将查找的步骤/链接告诉我好吗?
    非常感谢! 
    To:wj2929
    谢谢您的参考代码,我现在是要直接将C#/Java代码嵌入*.aspx页面之中:)
      

  9.   

    http://community.csdn.net/Expert/topic/4045/4045107.xml?temp=.5826227
      

  10.   

    可以的,参照下面的(下面的运行带参数)
    //调用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();