C#.netÖÐÓÃWinForm½ÓÊÕhtmlÒ³ÃæÏûÏ¢µÄ³ÌÐò
Ê×ÏÈдһ¸öÒ³Ãæ£¬ÉÏÃæÒª·ÅÒ»¸öButton
<html>
<head>
<title></title>
</head>
<body>
<input id="Button1" type="button" value="button" />
</body>
</html>
½«Æä±£´æÔÚHomePage.htmÖУ¬
Ö®ºóÎÒÃǽ¨Ò»¸öWinForm£¬
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace SXT.Frame.Ctrler.Test
{
public partial class HtmlUi : Form
{
public HtmlUi()
{
InitializeComponent();
this.webBrowser1.Navigate("D:\\SXT\\bin\\Debug\\HomePage.htm");//±¾µØÎļþ·¾¶
}
private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
{
HtmlDocument htmlDoc = this.webBrowser1.Document;
HtmlElement btnElement = htmlDoc.All["Button1"];
if (btnElement != null)
{
btnElement.Click += new HtmlElementEventHandler(btnElement_Click);
}
}
void btnElement_Click(object sender, HtmlElementEventArgs e)
&n
Ïà¹ØÎĵµ£º
http://blog.stchur.com/2010/01/15/programmatically-clicking-a-link-in-javascript/
×÷Õß½éÉÜÈçºÎÓÃjavascriptÄ£ÄâÓû§ÕæÊµµÄµã»÷¡£
Õâ¿´ÉÏÈ¥ºÃÏñºÜ¼òµ¥£¬¶ÁÈ¡hrefÈ»ºóÀûÓÃwindow.location.href²»¾ÍÐÐÁËÂð£¿
Æäʵ²»È»£¬ÔÒòÔÚÓÚÏÖÔÚµÄÍøÒ³ÀïµÄÁ´½Ó²»µ¥ÊÇÖ±½Ó¶ÁÈ¡hrefÊôÐÔÈ»ºóÌø×ªµ½ÁíÒ»¸öÒ³Ãæ£¬ÓÐЩÁ´½Ó¿ÉÒÔ¼ÓÉÏevent ......
1£¬Builderģʽ
¢Ù ¼ÙÉè¹¹½¨Ò»¸ö·¿ÎÝHouseÀ࣬¸Ã·¿ÎÝÓм¸¸ö²¿·Ö×é³É£¬±ÈÈçÃÅ£¬´°£¬Ç½£¬¶øÆäÿ¸ö²¿·Ö¶¼¸»Óڱ仯£¬Èç¸öÑùʽµÄÃÅ£¬Ã¿¸öÑùʽ¶¼ÓÐÒ»¸ö»òÕß¼¸¸ö
¢Ú Èç¹ûʹÓÃÖ±¹ÛµÄÉè¼Æ·½·¨£¬Ã¿Ò»¸ö·¿Îݲ¿·ÖµÄ±ä»¯£¬¶¼½«µ¼Ö·¿ÎÝÒªÖØÐÂÐÞÕý£¨µ«ÊÇ·¿ÎÝ£¬ÃÅ£¬´°£¬Ç½¶¼Ã»Óб仯£©
ʵ¼ÊÉÏÊÇÓÃÀ´Ó¦¶Ô£¬ÏµÍ³µÄÖ÷ÏßÏà¶ÔÎȶ¨£ ......
public void ExportControl(System.Web.UI.Control source, string DocumentType, string filename)
{
//ÉèÖÃHttpµÄÍ·ÐÅÏ¢,±àÂë¸ñʽ
HttpContext.Current.Response.Buffer = true;
HttpContext.Current.Response.Clear();
HttpContext.Current.Response.ClearContent();
......
html ÍøÒ³ÃèÊöÓïÑÔ
htmlµÄ»ù±¾¿ò¼Ü
<head> //±êǩͷ
<javacript> &nb ......
HTML±í¸ñºÜÈÝÒ×ÉÏÊÖ£¬Ò»¶Ñtr¼Ótd¾Í¿ÉÒÔÏÔʾһÕűí¸ñÁË¡£¸´ÔÓÒ»µã¾ÍÊÇÔÙ¼ÓÉÏth£¬colgroup£¬tbody£¬tfooter£¬captionÖ®Àà¡£ÕâЩHTMLÀïÃæµÄ¸÷ÖÖÔªËØµÄÈ·¼ÓÇ¿Á˱í¸ñµÄʵÓÃÐÔºÍÓïÒ廯£¬µ«table±¾Éí¾ÍÓкܴóѧÎÊŶ£¬±Ï¾¹ÊÇÕû¸ö±í¸ñµÄ¸ù°¡£¡
½ñÌìÏÂÃæÒª×ܽá°üº¬¶Ôtable±¾ÉíµÄÊôÐÔ¹éÄɺÍtableרÓõÄCSS±È½Ï£º
attributes VS CSS ......