Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

asp.netÉú³É¾²Ì¬Ò³(Ö®¶þ)

ÏȽ¨¸öhtmlÄ£°æÒ³(template.htm)£º
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
 
<title>$title</title>
 
</head>
 
<body>
<table $htmlformat[0] height="100%" border="0" width="100%" cellpadding="10" cellspacing="0" bgcolor="#eeeeee" style="border:1px solid #000000">
<tr>
<td width="100%" valign="middle" align="left">
<span style="color: $htmlformat[1];font-size: $htmlformat[2]">$htmlformat[3]</span>
</td>
</tr>
</table>
</body>
</html>
ÔÙн¨Ò»¸öaspxµÄÎļþ,Ìí¼Ó´úÂëÈçÏÂ:
string[] format=new string[4];//¶¨ÒåºÍhtmlyem±ê¼ÇÊýÄ¿Ò»ÖµÄÊý×é
           StringBuilder htmltext=new StringBuilder();
           try
           {
            using (StreamReader sr= new StreamReader(base.Server.MapPath(".")+"\\template.htm"))
¡¡            {
¡¡¡¡            String line;
¡¡¡¡            while ((line = sr.ReadLine()) != null)
¡¡¡¡            {
¡¡¡¡¡¡             htmltext.Append(line);
¡¡¡¡            }
¡¡¡¡            sr.Close();
¡¡            }
           }
     


Ïà¹ØÎĵµ£º

ASP.NET³ÌÐòÖг£ÓôúÂë»ã×Ü


ASP.NET³ÌÐòÖг£ÓôúÂë»ã×Ü
1.×Ô¶¨ÒåÒì³£´¦Àí
//×Ô¶¨ÒåÒì³£´¦ÀíÀà
using System;
using System.Diagnostics;
namespace MyAppException
{
¡¡/// £¼summary£¾
¡¡/// ´ÓϵͳÒì³£ÀàApplicationException¼Ì³ÐµÄÓ¦ÓóÌÐòÒì³£´¦ÀíÀà¡£
¡¡/// ×Ô¶¯½«Òì³£ÄÚÈݼǼµ½Windows NT/2000µÄÓ¦ÓóÌÐòÈÕÖ¾
¡¡/// £¼/summary£¾ ......

asp.netÔÚÏßÈËÊýͳ¼Æ

ÓÐÈËÒ²ÎÊÁ˸öÔÚÏßͳ¼ÆµÄÎÊÌ⣬ÎҵļûÒâÊÇÕâÑùµÄ£º  
  ÔÚApplication_StartʼþÖмÓÈëÒÔÏ´úÂ룺  
  Application.Lock();  
  Application.["UserCount"]=0;  
  Application.Unlock();  
   
  Session_Startʼ ......

asp.netÑéÖ¤¿Ø¼þ²»Æð×÷ÓõĽâ¾ö°ì·¨

×î½üд³ÌÐòÒ»Ö±³öÎÊÌ⣬ÒÔÇ°Ò»¸öÕ¾Èý¼¸Ìì¾ÍÇáËɸ㶨£¬ÏÖÔÚÒ»¸öÄ£¿é¾­³£¸ã°ëÌ죬NND
ÏÂÎ翪·¢¿áÒ×»¯×±Æ·É̳Ç(http://www.koyee.net)Ò»¸ö±íµ¥Ìá½»¹¦ÄÜÄ£¿é£¬±¾µØÈκÎÎÊÌⶼûÓÐÁË£¬´«µ½·þÎñÆ÷Éϱ¾ÒÔΪûÊÂÁË£¬ºóÀ´Ò»¼ì²éËùÓеÄÑéÖ¤¿Ø¼þ¶¼²»Æð×÷ÓÃÁË£¬Ö±½Ó¶¼Ìá½»¹ýÈ¥ÁË£¬ÓôÃÆ£¬Ô­ÒÔΪ³ÌÐò±»¸Ä´íÁË£¬¼ì²é±¾µØ»¹ÊÇûÈκÎÎÊÌ⣬¼ ......

ÀûÓÃASP.NET¼¼Êõ¶¯Ì¬Éú³ÉHTMLÒ³Ãæ

ÎÄÕ³ö´¦£ºhttp://hi.baidu.com/richiezheng/blog/item/8bb94b8692315b3867096efa.html
ÀûÓÃASP.NET¼¼Êõ¶¯Ì¬Éú³ÉHTMLÒ³Ãæ
˼·
¡¡¡¡1. ÀûÓÃÈçDw-MxÕâÑùµÄ¹¤¾ßÉú³Éhtml¸ñʽµÄÄ£°å£¬ÔÚÐèÒªÌí¼Ó¸ñʽµÄµØ·½¼ÓÈëÌØÊâ±ê¼Ç(Èç$htmlformat$),¶¯Ì¬Éú³ÉÎļþʱÀûÓôúÂë¶ÁÈ¡´ËÄ£°å£¬È»ºó»ñµÃǰ̨ÊäÈëµÄÄÚÈÝ£¬Ìí¼Óµ½´ËÄ£°åµÄ±ê¼ÇλÖÃÖ ......

LiteralÓëlabelµÄÇø±ð (asp.net C#)


Ò».Literal Web ·þÎñÆ÷¿Ø¼þ¸ÅÊö£¨ÕªÓÚMSDN£©
¿ÉÒÔʹÓà Literal Web ·þÎñÆ÷¿Ø¼þ×÷ΪҳÃæÉÏÆäËûÄÚÈݵÄÈÝÆ÷¡£Literal ×î³£ÓÃÓÚÏòÒ³ÃæÖж¯Ì¬Ìí¼ÓÄÚÈÝ¡£
Literal ¿Ø¼þ±íʾÓÃÓÚÏòÒ³ÃæÌí¼ÓÄÚÈݵļ¸¸öÑ¡ÏîÖ®Ò»¡£¶ÔÓÚ¾²Ì¬ÄÚÈÝ£¬ÎÞÐèʹÓÃÈÝÆ÷£¬¿ÉÒÔ½«±ê¼Ç×÷Ϊ HTML
Ö±½ÓÌí¼Óµ½Ò³ÃæÖС£µ«ÊÇ£¬Èç¹ûÒª¶¯Ì¬Ìí¼ÓÄÚÈÝ£¬Ôò±ØÐ뽫ÄÚÈÝÌí¼ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ