dddd.htm
<TR bgColor=#ffffff width="00%">
<TD align=middle colSpan=>
<form id="form">
<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="button">
-----------------------------------------------------------------------------------
form.cs
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using mshtml;
namespace WindowsApplication
{
/// <summary>
/// Form 的摘要说明。
/// </summary>
public class Form : System.Windows.Forms.Form
{
private AxSHDocVw.AxWebBrowser axWebBrowser;
private System.Windows.Forms.Button button;
private System.Windows.Forms.Button button;
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.Container components = null;
public Form()
{
//
// 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(Form));
this.axWebBrowser = new AxSHDocVw.AxWebBrowser();
this.button = new System.Windows.Forms.Button();
this.button = new System.Windows.Forms.Button();
((System.ComponentModel.ISupportInitialize)(this.axWebBrowser)).BeginInit();
this.SuspendLayout();
//
// axWebBrowser
//
this.axWebBrowser.Enabled = true;
this.axWebBrowser.Location = new System.Drawing.Point(80, 8);
this.axWebBrowser.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("axWebBrowser.OcxState")));
this.axWebBrowser.Size = new System.Drawing.Size(00, 0);
this.axWebBrowser.TabIndex = 0;
//
// button
//
this.button.Location = new System.Drawing.Point(60, 96);
this.button.Name = "button";
this.button.Size = new System.Drawing.Size(88, );
this.button.TabIndex = ;
this.button.Text = "button";
this.button.Click += new System.EventHandler(this.button_Click);
//
// button
//
this.button.Location = new System.Drawing.Point(0, 96);
this.button.Name = "button";
this.button.TabIndex = ;
this.button.Text = "button";
this.button.Click += new System.EventHandler(this.button_Click);
//
// Form
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, );
this.ClientSize = new System.Drawing.Size(8, 97);
this.Controls.Add(this.button);
this.Controls.Add(this.button);
this.Controls.Add(this.axWebBrowser);
this.Name = "Form";
this.Text = "Form";
((System.ComponentModel.ISupportInitialize)(this.axWebBrowser)).EndInit();
this.ResumeLayout(false);
}
#endregion
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main()
{
Application.Run(new Form());
}
private void button_Click(object sender, System.EventArgs e)
{
object x = System.Reflection.Missing.Value;
axWebBrowser.Navigate(@"E:\Documents and Settings\Administrator\桌面\dddd.htm", ref x, ref x, ref x, ref x);
}
private void button_Click(object sender, System.EventArgs e)
{
mshtml.IHTMLDocument doc = (mshtml.IHTMLDocument)axWebBrowser.Document;
mshtml.IHTMLFormElement f =(mshtml.IHTMLFormElement)doc.all.item ("form",0);
((mshtml.IHTMLFormElement)(f)).submit();
mshtml.IHTMLElement Element = (mshtml.IHTMLElement)doc.all.item("button", 0);
Element.click();
}
}
}









