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
Ïà¹ØÎĵµ£º
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();
......
//»ñÈ¡°üº¬Çåµ¥µÄÒѼÓÔØÎļþµÄ·¾¶»ò UNC λÖá£
public static string sApplicationPath = Assembly.GetExecutingAssembly ( ).Location;
//result: X:\xxx\xxx\xxx.dll (.dllÎļþËùÔÚµÄĿ¼+.dllÎļþÃû)
//»ñÈ¡µ±Ç°½ø³ÌµÄÍêÕû·¾¶£¬°üº¬ÎļþÃû(½ø³ÌÃû)¡£
string str = this.GetType ( ).Assembly.Location;
//result ......
c# ÖÐ isºÍas ²Ù×÷·ûÊÇÓÃÀ´½øÐÐÇ¿ÖÆÀàÐÍת»»µÄ
is : ¼ì²éÒ»¸ö¶ÔÏóÊÇ·ñ¼æÈÝÓÚÆäËûÖ¸¶¨µÄÀàÐÍ,²¢·µ»ØÒ»¸öBoolÖµ,ÓÀÔ¶²»»áÅ׳öÒì³£
object o = new object();
if (o is Label)
{
Label lb = (Label)o;
Response.Write("ÀàÐÍת»»³É¹¦");
}
else
{
Response.Write(" ......
ʲôÊÇCache¶ÔÏó?
ÄãÔÚÉú³É¸ßÐÔÄÜÍøÂçÓ¦ÓóÌÐòʱËùÓöµ½µÄÒ»¸öÎÊÌâ¾ÍÊÇÐèÒª±ÜÃâÖØ¸´¡£Ò»¸öCache¶ÔÏóÔÊÐíÔÚËüÃǵÚÒ»´Î±»ÇëÇóʱÔÚÄÚ´æÖлº´æÏȻºó½«±»»º´æµÄ¸±±¾ÓÃÓÚÒÔºóµÄÇëÇó¡£Ê¹Óñ»»º´æµÄ¸±±¾ÔÊÐíÄã±ÜÃâÖØ½¨Âú×ãÒÔǰÇëÇóµÄÐÅÏ¢£¬ÌرðÊÇÄÇЩÿ´Î´´½¨Ê±¶¼ÐèÕ¼ÓÐÃ÷ʾµÄ·þÎñÆ÷ÉϵĴ¦ÀíÆ÷ʱ¼äµÄÃüÁî¡£
³ý»º´æ¸ö±ðÏÈç» ......
ÏÈÀ´¿´¶Î´úÂ룺
document.domain = 'ray.com';
Õâ¶Î´úÂëµ½µ×ÊÇʲôÒâË¼ÄØ£¿
Ê×ÏÈ£¬ÎÒÃÇÀ´¿´ÏÂHTML DOM ¹ØÓÚÕâ¸öµÄ˵Ã÷£º
domain of type DOMString, readonlyThe domain name of the server that served the document, or null if the server cannot be identified by a domain name.
Õâ¶Î»°µÄÒâ˼ÊÇÕâ¸öÖµÊÇDO ......