静观其变

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::



<TR bgColor=#ffffff width="100%">
<TD align=middle colSpan=2>
<form id="form1">
<INPUT language=javascript class=button id=Btton style="BORDER-TOP-STYLE: groove; BORDER-RIGHT-STYLE: groove; BORDER-LEFT-STYLE: groove; BORDER-BOTTOM-STYLE: groove" onclick="if (typeof(Page_ClientValidate) == ''function'') Page_ClientValidate(); " type=submit value="Start" onclick="alert(''dd'')" name=Btton></TD></TR>
</form> 


<input type="button" onclick="alert(''test'')" id="button1">


-----------------------------------------------------------------------------------
form1.cs


using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using mshtml;


namespace WindowsApplication2
{
/// <summary>
/// Form1 的摘要说明。
/// </summary>

public class Form1 : System.Windows.Forms.Form
{
private AxSHDocVw.AxWebBrowser axWebBrowser1;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Button button2;
/// <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 );
}



Windows 窗体设计器生成的代码


/// <summary>
/// 应用程序的主入口点。
/// </summary>

[STAThread]
static void Main() 
{
Application.Run(
new Form1());
}



private void button1_Click(object sender, System.EventArgs e)
{
object x = System.Reflection.Missing.Value;
axWebBrowser1.Navigate(
@"E:\Documents and Settings\Administrator\桌面\dddd.htm"ref x, ref x, ref x, ref x);
}



private void button2_Click(object sender, System.EventArgs e)
{
mshtml.IHTMLDocument2 doc 
= (mshtml.IHTMLDocument2)axWebBrowser1.Document;
mshtml.IHTMLFormElement f1 
=(mshtml.IHTMLFormElement)doc.all.item ("form1",0);
((mshtml.IHTMLFormElement)(f1)).submit();
mshtml.IHTMLElement Element 
= (mshtml.IHTMLElement)doc.all.item("button1"0);
Element.click();
}

}

}

posted on 2005-02-25 16:53  wangyue  阅读(1077)  评论(0编辑  收藏  举报