ASP.NET Cache»º´æÏê½â
Àý×Ó£º
using system.web.caching
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.SqlClient" %>
<html>
<script language="C#" runat="server">
void Page_Load(Object Src, EventArgs E) {
DataView Source;
// Retrieve the DataView object from Cache. If not exist, then add DataView object to the Cache.
Source = (DataView)Cache["MyDataSet"];
if (Source == null) {
SqlConnection myConnection = new SqlConnection("Server=ServerName; database=Pubs; user id=UID; password=PWD;");
SqlDataAdapter myCommand = new SqlDataAdapter("select * from Authors", myConnection);
DataSet ds = new DataSet();
myCommand.Fill(ds, "Authors");
Source = new DataView(ds.Tables["Authors"]);
Cache["MyDataSet"] = Source;
CacheMsg.Text = "Dataset created explicitly";
}
else {
CacheMsg.Text = "Dataset retrieved from cache";
}
// Binding the DataView object with DataGrid.
MyDataGrid.DataSource=Source;
MyDataGrid.DataBind();
}
</script>
<body>
<form method="GET" runat="server">
<h3><font face="Verdana">Caching Data</font></h3>
<ASP:DataGrid id="MyDataGrid" runat="server"
Width="700"
BackColor="#ccccff"
BorderColor="black"
ShowFooter="false"
CellPadding=3
CellSpacing="0"
Font-Name="Verdana"
Font-Size="8pt"
HeaderStyle-BackColor="#aaaad" />
<p>
<i><asp:label id="CacheMsg" runat="server"/></i>
</form>
</body>
</html>
ASP.NET CacheÊÇÌáÉýϵͳÐÔÄܵÄÖØÒª·½·¨£¬ËüʹÓÃÁË“×î½üʹÓÔÔÔò£¨a least-recently-used algorithm£©¡£ÔÚÊý¾Ý¿â·ÃÎÊÖо³£»áÓõ½Cache±£´æÊý¾Ý¿âÊý¾Ý¡£ 1.»º´æµÄÌí¼Ó£ºCacheµÄÌí¼Ó·½·¨ÓÐAdd()»òInsert£¨£©£¬Á½ÖÖ·½·¨¼¸ºõÀàËÆ£¬Ö»ÊÇInser·½·¨¿ÉÒÔʹÓÿÉÑ¡²ÎÊý£¬¼´Ê¹ÓÃĬÈϲÎÊý£¬À´ÊµÏÖ»º´æµÄÌ
Ïà¹ØÎĵµ£º
ÕâÒ²ÐíÊÇÒ»¸öСÎÊÌâ µ«ÊÇÓкܶàѧÎÊ ²»ÄÜÑÛ¸ßÊÖµÍ ÎҰѴ󲿷ÖÇé¿öÁгöÀ´ ¸ø´ó¼ÒÒ»¸öÌáÐÑ
float str = 987654.32F;
//Response.Write(string.Format("{0:c}", str));
//this.Label1.Text = string.Format("{0:D}", str);
//this.Label1.Text = string.Format("{0:C}", str); ......
´Ë´¦ÌṩµÄ´úÂëÓÃÀ´ÊµÏÖµ±asp.netÒ³ÃæÖеÄij¸öButton±»µã»÷ºódisableµô¸ÃÒ³ÃæÖÐËùÓеÄButton£¬´Ó¶ø·ÀÖ¹Ìá½»ÑÓʱµ¼ÖµĶà´ÎÌá½»¡£»ùÓÚ֮ǰµÄonceclickbutton½Å±¾.
//ASP.NETÖзÀÖ¹Ò³Ãæ¶à´ÎÌá½»µÄ´úÂë:javascript< script language="javascript"> < !-- function disableOtherSubmit() {
var obj = event.srcElem ......
ASP.NetÓʼþ·¢ËÍÀà
±¾ÎÄת×Ô£ºhttp://www.pcstu.com/program/Asp_net/sl/20070706/52523.html
˵Ã÷£º±¾ÎÄûÓвâÊÔ£¬µ«¿´ÆðÀ´Ëƺõ²»ÄÜÓÃÓÚ·¢Ë͸½¼þ£¬ÈçÒª·¢Ë͸½¼þ£¬¿É²Î¿¼£ºhttp://blog.csdn.net/lff642/archive/2008/07/15/2654346.aspx
using System;
using System.Text;
using System.IO;
using System.Net;
using ......
ASP.NET Web »º´æÔöÇ¿ÐÔÄܺͿÉÉìËõÐÔ
¸ÅÀÀ£º
Æ¿¾±ÏÞÖÆÏÔÖø½µµÍ
¾²Ì¬ºÍ¶¯Ì¬ Web »º´æ
±Ø±¸µÄ¹¦ÄÜ£º¹ýÆÚ¡¢Êý¾Ý¿âÒÀÀµ¹ØÏµ¡¢PDF ²¿·ÖÄÚÈÝÒÔ¼°¸ü¶à¹¦ÄÜ
¶ÔÈ«Çò×éÖ¯µÄÌØÊâºÃ´¦
Web »º´æ·þÎñÆ÷Ⱥ¼¯
Ãâ·ÑºÍÉÌÓýâ¾ö·½°¸
Contents
ÎÊÌ⣺ASP.NET Æ¿¾±ÏÞÖÆ
½â¾ö·½°¸£ºASP.NET Web »º´æ
Web »º´æÖ ......
ASP.NET C# Éú³É¾²Ì¬Ò³Ãæ¼òµ¥·½·¨
//Ô´ÂëÊÇÌæ»»µôÄ£°åÖеÄÌØÕ÷×Ö·û
string mbPath = Server.MapPath("template.html");
Encoding cod ......