在IE中使用VS.net WinForm控件 
http://www.csdn.net/Develop/Read_Article.asp?Id=24884

解决方案 »

  1.   

    ??纳闷,为什么有webform不用,用winform,好像不行
      

  2.   

    没有,原来是cs的,老板要换bs的
      

  3.   

    http://chs.gotdotnet.com/quickstart/winforMS/doc/WinForMSIeSourcing.aspx
    讲得满详细的
      

  4.   

    以前翻的,希望对楼主有帮助 
    http://www.csdn.net/Develop/read_article.asp?id=27636
    http://www.csdn.net/Develop/read_article.asp?id=27639
    http://www.csdn.net/Develop/read_article.asp?id=27640
      

  5.   

    upto(阿球) :你觉得这样比用webform再写一次收到很多挫折要多阿?
      

  6.   

    对!而且最终客户会不满意。主要是这个技术不成熟,不好用,我以前搞过,权限问题就够你烦了。
    调用API都不可以。你可以看看MSDN文档里面关于.NET的安全模型
      

  7.   

    用webform实现只是工作量的问题,而用WinForm嵌入ie是技术的问题。你说那个挫折大?
      

  8.   

    还是用winform控件放入到web页中比较好,功能上比较实用
      

  9.   

    哈哈,弄不懂哈, WINFORM用在IE中?????????那客户端如果没有.NET框架..你咋办???????????????????????ASP+可以在服务器端执行,只返回给IE代码...WINFORM....难道也要在服务器上执行????????????????????我以前做过VB的WINFORM在IE中运行的例子..但那并不需要框架的哦.
      

  10.   

    using System;
    using System.Diagnostics;
    using System.Drawing;
    using System.Collections;
    using System.ComponentModel;
    using System.Windows.Forms;
    using System.Data;namespace 浏览器测试
    {
    /// <summary>
    /// Form1 的摘要说明。
    /// </summary>
    public class Form1 : System.Windows.Forms.Form
    {
    private AxSHDocVw.AxWebBrowser axWebBrowser1;
    private System.Windows.Forms.Button button1;
    private System.Windows.Forms.TextBox textBoxUrl;
    private System.Windows.Forms.Button buttonGo;
    /// <summary>
    /// 必需的设计器变量。
    /// </summary>
    private System.ComponentModel.Container components = null; public Form1()
    {
    //
    // Windows 窗体设计器支持所必需的
    //
    InitializeComponent(); //
    // TODO: 在 InitializeComponent 调用后添加任何构造函数代码
    //
    } /// <summary>
    /// 清理所有正在使用的资源。
    /// </summary>
    protected override void Dispose( bool disposing )
    {
    if( disposing )
    {
    if (components != null) 
    {
    components.Dispose();
    }
    }
    base.Dispose( disposing );
    } #region Windows 窗体设计器生成的代码
    /// <summary>
    /// 设计器支持所需的方法 - 不要使用代码编辑器修改
    /// 此方法的内容。
    /// </summary>
    private void InitializeComponent()
    {
    System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(Form1));
    this.axWebBrowser1 = new AxSHDocVw.AxWebBrowser();
    this.textBoxUrl = new System.Windows.Forms.TextBox();
    this.button1 = new System.Windows.Forms.Button();
    this.buttonGo = new System.Windows.Forms.Button();
    ((System.ComponentModel.ISupportInitialize)(this.axWebBrowser1)).BeginInit();
    this.SuspendLayout();
    // 
    // axWebBrowser1
    // 
    this.axWebBrowser1.Enabled = true;
    this.axWebBrowser1.Location = new System.Drawing.Point(0, 48);
    this.axWebBrowser1.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("axWebBrowser1.OcxState")));
    this.axWebBrowser1.Size = new System.Drawing.Size(592, 320);
    this.axWebBrowser1.TabIndex = 0;
    // 
    // textBoxUrl
    // 
    this.textBoxUrl.Location = new System.Drawing.Point(48, 16);
    this.textBoxUrl.Name = "textBoxUrl";
    this.textBoxUrl.Size = new System.Drawing.Size(344, 21);
    this.textBoxUrl.TabIndex = 1;
    this.textBoxUrl.Text = "http://";
    // 
    // button1
    // 
    this.button1.Location = new System.Drawing.Point(400, 16);
    this.button1.Name = "button1";
    this.button1.TabIndex = 2;
    this.button1.Text = "新窗口打开";
    this.button1.Click += new System.EventHandler(this.button1_Click);
    // 
    // buttonGo
    // 
    this.buttonGo.Location = new System.Drawing.Point(488, 16);
    this.buttonGo.Name = "buttonGo";
    this.buttonGo.TabIndex = 3;
    this.buttonGo.Text = "本窗打开";
    this.buttonGo.Click += new System.EventHandler(this.buttonGo_Click);
    // 
    // Form1
    // 
    this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
    this.ClientSize = new System.Drawing.Size(592, 365);
    this.Controls.Add(this.buttonGo);
    this.Controls.Add(this.button1);
    this.Controls.Add(this.textBoxUrl);
    this.Controls.Add(this.axWebBrowser1);
    this.Name = "Form1";
    this.Text = "Form1";
    this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
    ((System.ComponentModel.ISupportInitialize)(this.axWebBrowser1)).EndInit();
    this.ResumeLayout(false); }
    #endregion /// <summary>
    /// 应用程序的主入口点。
    /// </summary>
    [STAThread]
    static void Main() 
    {
    Application.Run(new Form1());
    } private void button1_Click(object sender, System.EventArgs e)
    {
    Process p=new Process();//实例化进程对象
    string url=textBoxUrl.Text.Trim();//获取输入的Url
    //StartInfo用于设置启动进程所需参数
    p.StartInfo.FileName="iexplore.exe";//设置要启动的应用程序或文档
    p.StartInfo.Arguments=url;//设置启动所需命令行参数
    p.Start();//将进程与Process组件关联并启动
    } private void buttonGo_Click(object sender, System.EventArgs e)
    {
    string url=textBoxUrl.Text;//取Url值
    object o=null;//定义空的对象引用
    axWebBrowser1.Navigate(url,ref o,ref o,ref o,ref o);//浏览到指定资源
    }
    }
    }
    需要引用:
    AxSHDocVw,SHDocVw。自己按照:
    private AxSHDocVw.AxWebBrowser axWebBrowser1;
    private System.Windows.Forms.Button button1;
    private System.Windows.Forms.TextBox textBoxUrl;
    private System.Windows.Forms.Button buttonGo;画几个控件,把代码拷过去就能用了。
      

  11.   

    做成三层结构吧,用DCOM就好了,很多大型的BS结构软件都是这样做。
      

  12.   

    应该说这项技术是很实用的,随着windows2003的成熟。.net的成熟.这种有强大功能的技术会得到越来越广泛的应用
      

  13.   

    http://www.csdn.net/Develop/read_article.asp?id=27636
    http://www.csdn.net/Develop/read_article.asp?id=27639
    http://www.csdn.net/Develop/read_article.asp?id=27640
      

  14.   

    我作过,exe也可以的,不只是控件。
    这个东西是网络下载的代码,和applet一样,当然要有权限限制了,否则随便调用dll不是乱套了?总的来说,下载的代码访问原来机器上的数据库或者ws都是允许的。
    如果客户端没有安装clr, 则需要提示客户端下载,这个也不难,clr在本地放一个,也很快。不过有时候会有小问题,比如focus都要权限。
    可以签名或者信任域解决。
      

  15.   

    非常感谢 usepc(usepc) 大侠