日期:2014-05-17  浏览次数:20479 次

|M| 第二贴:500分Web调用WinForm问题 如何在我的ASP。NET2.0中的按钮点击执行WinForm程序
http://community.csdn.net/Expert/topic/5517/5517325.xml?temp=.8740045

注册表中

HKEY_CLASSES_ROOT下加一个项

名称为你的程序名称:

然后在这个项下加一个   字串,名称为URL   Protocol

然后在这个项下添加

Shell/Open/Command三个项
command的默认值改成你的程序路径(含文件)   %1   %1是指参数.

上面是cpp2017(慕白兄)的
不明白的是:(含文件)   %1   %1是指参数.
那个默认值我的是:
F:\学习工具\PrintClient\PrintClient\PrintClient\bin\Debug\PrintClient.exe

然后在这个PrintClient中的Form1中有Button1有事件
namespace   PrintClient
{
        public   partial   class   Form1   :   Form
        {
                public   Form1()
                {
                        InitializeComponent();
                }

                private   void   button1_Click(object   sender,   EventArgs   e)
                {
                        MessageBox.Show( "OK ");
                }
        }
}
然后WEB中有Default.aspx   有
public   partial   class   _Default   :   System.Web.UI.Page  
{
        protected   void   Page_Load(object   sender,   EventArgs   e)
        {

        }
        protected   void   Button1_Click(object   sender,   EventArgs   e)
        {
                  //点击这里调用WinForm   Button   事件
        }
}


------解决方案--------------------
这也有可能吗?
------解决方案--------------------
进来学习
------解决方案--------------------
学习学习!
------解决方案--------------------

------解决方案--------------------
在前台调用:
window.open( "程序名称:参数 ");