| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1641 人关注过本帖
标题:[求助]用c#编写 web浏览器
只看楼主 加入收藏
linxz1002
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2005-2-15
收藏
 问题点数:0 回复次数:14 
[求助]用c#编写 web浏览器

我想用 c#语言编写一个浏览器,具体的功能就和 微软的ie相似,请问该如何下手,谁有这个代码 借小弟一看可否?
QQ;31985632 mail:linxz1002@163.com

搜索更多相关主题的帖子: web 浏览器 编写 
2005-12-31 15:10
sosfos
Rank: 1
等 级:新手上路
帖 子:18
专家分:0
注 册:2005-8-16
收藏
得分:0 
呵呵,我只知道C#.net里面有这样的控件^_^

2005-12-31 16:56
lxtf214
Rank: 1
等 级:新手上路
帖 子:151
专家分:0
注 册:2005-12-29
收藏
得分:0 

(.NET Programmer ) 要为成功找方法,不为失败找理由
2005-12-31 17:57
nyzfl
Rank: 1
等 级:新手上路
帖 子:278
专家分:0
注 册:2005-3-21
收藏
得分:0 

我也正在做这个~~~
我的qq122375186 e-mail:cxsj123@126.com


My-Blog地址:http://fenglin.
2005-12-31 19:16
jack033
Rank: 1
等 级:新手上路
帖 子:64
专家分:0
注 册:2006-1-2
收藏
得分:0 
以下是引用lxtf214在2005-12-31 17:57:00的发言:
http://www.codeproject.com/csharp/webbrowser.asp

到这里去看看吧!

里面的都看不懂啊,我是刚开始C#的,不过我已经开始学控件了
以后希望大家多帮帮忙啊


我还是新手,在以后希望能得到大家的帮助~~~~
2006-01-02 20:04
cfg1014
Rank: 1
等 级:新手上路
帖 子:42
专家分:0
注 册:2006-1-7
收藏
得分:0 

没有看到这个控件啦,能不能说详细点?


2006-01-25 15:16
huoshanhui
Rank: 1
等 级:新手上路
帖 子:35
专家分:0
注 册:2005-12-5
收藏
得分:0 

using System ;
using System.Drawing ;
using System.Collections ;
using System.ComponentModel ;
using System.Windows.Forms ;
using System.Data ;
using AxSHDocVw ;
public class Form1 : Form
{
private ToolBar toolBar1 ;
private ToolBarButton tb1 ;
private ToolBarButton tb2 ;
private ToolBarButton tb3 ;
private ToolBarButton tb4 ;
private ToolBarButton tb5 ;
private Label label1 ;
private TextBox textBox1 ;
private Button button1 ;
private AxWebBrowser axWebBrowser1 ;
private System.ComponentModel.Container components = null ;
public Form1 ( )
{
InitializeComponent ( ) ;
}
//清除程序中使用过的资源
protected override void Dispose ( bool disposing )
{
if ( disposing )
{
if ( components != null )
{
components.Dispose ( ) ;
}
}
base.Dispose ( disposing ) ;
}
//初始化窗体中的各个组件
private void InitializeComponent ( )
{
tb1 = new ToolBarButton ( ) ;
tb2 = new ToolBarButton ( ) ;
tb3 = new ToolBarButton ( ) ;
toolBar1 = new ToolBar ( ) ;
tb4 = new ToolBarButton ( ) ;
tb5 = new ToolBarButton ( ) ;
button1 = new Button ( ) ;
textBox1 = new TextBox ( ) ;
axWebBrowser1 = new AxWebBrowser ( ) ;
label1 = new Label ( ) ;
( ( System.ComponentModel.ISupportInitialize ) ( this.axWebBrowser1 ) ).BeginInit ( ) ;
this.SuspendLayout ( ) ;

tb1.Text = "后退" ;
tb2.Text = "前进" ;

tb3.Text = "停止" ;
tb4.Text = "刷新" ;
tb5.Text = "主页" ;

toolBar1.Appearance = ToolBarAppearance.Flat ;
toolBar1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle ;
//在工具栏中加入按钮
toolBar1.Buttons.Add ( tb1 ) ;
toolBar1.Buttons.Add ( tb2 ) ;
toolBar1.Buttons.Add ( tb3 ) ;
toolBar1.Buttons.Add ( tb4 ) ;
toolBar1.Buttons.Add ( tb5 ) ;
toolBar1.DropDownArrows = true ;
toolBar1.Name = "toolBar1" ;
toolBar1.ShowToolTips = true ;
toolBar1.Size = new System.Drawing.Size ( 612 , 39 ) ;
toolBar1.TabIndex = 0 ;
toolBar1.ButtonClick += new ToolBarButtonClickEventHandler ( toolBar1_ButtonClick ) ;
//定位“转到”按钮组件与窗体的上、右边框保持一致
button1.Anchor = ( AnchorStyles.Top | AnchorStyles.Right ) ;
button1.DialogResult = DialogResult.OK ;
button1.Location = new System.Drawing.Point ( 544 , 45 ) ;
button1.Name = "button1" ;
button1.Size = new System.Drawing.Size ( 40 , 23 ) ;
button1.TabIndex = 3 ;
button1.Text = "转到" ;
button1.Click += new System.EventHandler ( button1_Click ) ;
//定位地址文本框组件与窗体的上、左、右边框保持一致
textBox1.Anchor = ( ( AnchorStyles.Top | AnchorStyles.Left )
| AnchorStyles.Right ) ;
textBox1.Location = new System.Drawing.Point ( 64 , 47 ) ;
textBox1.Name = "textBox1" ;
textBox1.Size = new System.Drawing.Size ( 464 , 21 ) ;
textBox1.TabIndex = 2 ;
textBox1.Text = "" ;
//定位浏览器组件与窗体的上、下、左、右边框保持一致
axWebBrowser1.Anchor = ( ( ( AnchorStyles.Top | AnchorStyles.Bottom )
| AnchorStyles.Left )
| AnchorStyles.Right ) ;
axWebBrowser1.Enabled = true ;
axWebBrowser1.Location = new System.Drawing.Point ( 0 , 72 ) ;
axWebBrowser1.Size = new System.Drawing.Size ( 608 , 358 ) ;
axWebBrowser1.TabIndex = 4 ;

label1.Location = new System.Drawing.Point ( 16 , 48 ) ;
label1.Name = "label1" ;
label1.Size = new System.Drawing.Size ( 48 , 16 ) ;
label1.TabIndex = 1 ;
label1.Text = "地址:" ;

this.AutoScaleBaseSize = new System.Drawing.Size ( 6 , 14 ) ;
this.ClientSize = new System.Drawing.Size ( 612 , 433 ) ;

this.Controls.Add ( axWebBrowser1 ) ;
this.Controls.Add ( button1 ) ;
this.Controls.Add ( textBox1 ) ;
this.Controls.Add ( label1 ) ;
this.Controls.Add ( toolBar1 ) ;
this.FormBorderStyle = FormBorderStyle.FixedSingle ;
this.Name = "Form1" ;
this.Text = "visual C#做浏览器" ;
( ( System.ComponentModel.ISupportInitialize ) ( this.axWebBrowser1 ) ).EndInit ( ) ;
this.ResumeLayout ( false ) ;

}


2006-01-25 15:48
huoshanhui
Rank: 1
等 级:新手上路
帖 子:35
专家分:0
注 册:2005-12-5
收藏
得分:0 
static void Main ( )
{
Application.Run ( new Form1 ( ) ) ;
}
//实现浏览器主要功能
private void toolBar1_ButtonClick ( object sender , ToolBarButtonClickEventArgs e )
{
//浏览器中的“后退”
if ( e.Button == tb1 )
{
axWebBrowser1.GoBack ( ) ;
}
//浏览器中的“前进”
if ( e.Button == tb2 )
{
axWebBrowser1.GoForward ( ) ;
}
//浏览器中的“停止”
if ( e.Button == tb3 )
{
axWebBrowser1.Stop ( ) ;
}
//浏览器中的“刷新”
if ( e.Button == tb4 )
{
axWebBrowser1.Refresh ( ) ;
}
//浏览器中的“主页”
if ( e.Button == tb5 )
{
axWebBrowser1.GoHome ( ) ;
}

}
//浏览指定的Web地址
private void button1_Click ( object sender , System.EventArgs e )
{
System.Object nullObject = 0 ;
string str = "" ;
System.Object nullObjStr = str ;
Cursor.Current = Cursors.WaitCursor ;
axWebBrowser1.Navigate ( textBox1.Text , ref nullObject , ref nullObjStr , ref nullObjStr , ref nullObjStr ) ;
Cursor.Current = Cursors.Default ;
}
}

2006-01-25 15:48
cfg1014
Rank: 1
等 级:新手上路
帖 子:42
专家分:0
注 册:2006-1-7
收藏
得分:0 

为什么我的没有这个控件?


2006-02-05 10:51
live41
Rank: 10Rank: 10Rank: 10
等 级:贵宾
威 望:67
帖 子:12442
专家分:0
注 册:2004-7-22
收藏
得分:0 

要自己在控件栏那里导入

2006-02-05 11:16
快速回复:[求助]用c#编写 web浏览器
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.012741 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved