´ó¼Ò°ïæ¿´¿´ ÎÒÔõô²ÅÄܰÑÊý¾Ý»»³ÉHTML¸ñʽµÄ
C# code:
protected void Button1_Click(object sender, EventArgs e)
{
string str = HttpContext.Current.Server.MapPath("/WebSite1");
str += @"\index.htm";
TextBox1.Text=this.getUrlContent(str);//»ñÈ¡HTML×ÊÔ´
string path = HttpContext.Current.Server.MapPath("/WebSite1");
path += @"\1.htm";
if (!File.Exists(path))
{
using (StreamWriter sw = File.CreateText(path))
{
[color=#FF0000] sw.WriteLine(TextBox1.Text);[/color] }
}
else
{
File.Delete(path);
using (StreamWriter sw = File.CreateText(path))
{
[color=#FF0000]sw.WriteLine(TextBox1.Text);[/color]
}
}
}
private string getUrlContent(string url)
{
if (url == null || url.Trim() == "")
return null;
WebClient wc = new WebClient();
wc.Credentials = CredentialCache.DefaultCredentials;
Byte[] pageData = wc.DownloadData(url);
return System.Text.Encoding.Default.GetString(pageData);//.ASCII.GetString
}
ºìÉ«²¿·Ö ½«Îı¾¿òµÄÄÚÈÝдÈë HTMLÎļþ ¿Éд½øÈ¥µÄÓÐЩÊÇÂÒÂë
¸÷λ´óÏÀ Ó¦¸ÃÔõô¸Ä ÄÜÈÃËû²»ÊÇÂÒÂë ¶øÊÇHMTL¸ñʽµÄÄØ
up
UP
Ïà¹ØÎÊ´ð£º
Ò»¸ö¾²Ì¬µÄhtmlÒ³Ãæ£¬ÃÀ»¯£¬½çÃæ²¼¾ÖÒѾ´¦ÀíºÃÁË £¬ÔÚ±àд³ÌÐòµÄʱºòÐèÒªÔÚת»¯³ÉJSPÒ³Ãæ£¬
ËùÒÔн¨Ò»¸öJSPÒ³Ãæ£¬½²ÔÀ´µÄ´úÂ뿽±´µ½ÀïÃæÈ¥£¬½á¹û²¼¾Ö±äÁË£¿
²»´æÔÚ·¾¶ÎÊÌâ!
ûÈË? ÕæÊ§°Ü!
......
ÎÒÒªµ÷ÊԽű¾ÓïÑÔ ÔÚVS2008ÀïHTMLµÄ½Å±¾²»Äܵ÷ÊÔ
ÔõôÄܰÑhTMLת»»³Éasp.netÎļþ
Áí´æÎªaspxÎļþ...
ºÇºÇ
ÎÒ˵µÄÓе㲻¶ÔÁË
ÄÇÀïÓÐÍâÃæÒýÈëµÄJSÎļþ HTML Ö±½Óµ÷ÓÃÄÇÀïµÄº¯Êý¿ÉÊÇ×°³ÉASPXºó¾ÍÕÒ²»µ½Ä ......
ÔõôÔÚ±íÍâÃæÌ×Ò»¸öÕý·½ÐεĿò
ÒÔ±í¸ñÍâ±ß¿òΪ׼£¡
HTML code:
<table id="mytable" align="center" cellspacing="0" summary="The technical specificati ......
<input id="Button1" type="button">ÕâÑùÒ»¸öhtml¿Ø¼þ,ÎÒÏëÈÃËûÖ´ÐÐc#Ò»¸öÀàµÄº¯Êý,ÈçºÎ×ö°¡??
<input id="Button1" type="button" value="buton" o ......
ÎÒÓÃÃÀ¹¤×öºÃµÄ HTML ÎÒÏë°ÑËû¸ÄΪJSP Îļþ¡£
ÎÒÊÇÕâÑù×öµÄ £¬ÏÈÔÚHTML ÎļþÖмÓÈ룬 <%@ page language="java" contentType="text/html; charset=GB18030"
pag ......