winform怎么放到ie里面去???? 在IE中使用VS.net WinForm控件 http://www.csdn.net/Develop/Read_Article.asp?Id=24884 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 ??纳闷,为什么有webform不用,用winform,好像不行 没有,原来是cs的,老板要换bs的 http://chs.gotdotnet.com/quickstart/winforMS/doc/WinForMSIeSourcing.aspx讲得满详细的 以前翻的,希望对楼主有帮助 http://www.csdn.net/Develop/read_article.asp?id=27636http://www.csdn.net/Develop/read_article.asp?id=27639http://www.csdn.net/Develop/read_article.asp?id=27640 upto(阿球) :你觉得这样比用webform再写一次收到很多挫折要多阿? 对!而且最终客户会不满意。主要是这个技术不成熟,不好用,我以前搞过,权限问题就够你烦了。调用API都不可以。你可以看看MSDN文档里面关于.NET的安全模型 用webform实现只是工作量的问题,而用WinForm嵌入ie是技术的问题。你说那个挫折大? 还是用winform控件放入到web页中比较好,功能上比较实用 哈哈,弄不懂哈, WINFORM用在IE中?????????那客户端如果没有.NET框架..你咋办???????????????????????ASP+可以在服务器端执行,只返回给IE代码...WINFORM....难道也要在服务器上执行????????????????????我以前做过VB的WINFORM在IE中运行的例子..但那并不需要框架的哦. 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;画几个控件,把代码拷过去就能用了。 做成三层结构吧,用DCOM就好了,很多大型的BS结构软件都是这样做。 应该说这项技术是很实用的,随着windows2003的成熟。.net的成熟.这种有强大功能的技术会得到越来越广泛的应用 http://www.csdn.net/Develop/read_article.asp?id=27636http://www.csdn.net/Develop/read_article.asp?id=27639http://www.csdn.net/Develop/read_article.asp?id=27640 我作过,exe也可以的,不只是控件。这个东西是网络下载的代码,和applet一样,当然要有权限限制了,否则随便调用dll不是乱套了?总的来说,下载的代码访问原来机器上的数据库或者ws都是允许的。如果客户端没有安装clr, 则需要提示客户端下载,这个也不难,clr在本地放一个,也很快。不过有时候会有小问题,比如focus都要权限。可以签名或者信任域解决。 非常感谢 usepc(usepc) 大侠 winform界面响应和键盘事件 gridview里checkbox选择的问题 基类非抽象类时,如何强制派生类实现某方法? 高手求救,急急急,关于dll组件的引用 Tamir.IPLib怎么引用 日文的VS2008 运行中文工程 Hashtable中 如何根据它的KEY得到VALUE值? 看不懂这段代码中delegate?别笑我! XmlDocument的LoadXml的问题~~~~~~~~~ 简单的UploadValues(Uri,"POST",nvc)上传登录信息问题 有人用C#解析过 raw TCP packet 吗? 小问题一个,请大家帮忙
讲得满详细的
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
调用API都不可以。你可以看看MSDN文档里面关于.NET的安全模型
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;画几个控件,把代码拷过去就能用了。
http://www.csdn.net/Develop/read_article.asp?id=27639
http://www.csdn.net/Develop/read_article.asp?id=27640
这个东西是网络下载的代码,和applet一样,当然要有权限限制了,否则随便调用dll不是乱套了?总的来说,下载的代码访问原来机器上的数据库或者ws都是允许的。
如果客户端没有安装clr, 则需要提示客户端下载,这个也不难,clr在本地放一个,也很快。不过有时候会有小问题,比如focus都要权限。
可以签名或者信任域解决。