易截截图软件、单文件、免安装、纯绿色、仅160KB

asp.net性能

 1.关闭不必要的Session
<%@ Page EnableSessionState="flase"%>
2.关闭不必要的ViewState
<asp:DataGrid EnableViewState="false" runat="server">
如果页面级
<%@ Page EnableViewState="false"%>
3.不要使用Exception控制程序流程
  Exception是很耗资源的
4.禁用VB和JScript动态数据类型
动态数据类型是要占用大量的CPU运行时间
<%@ Page Language="VB" Strict="true"%>
5.使用存储过程的数据访问
6.只读数据访问不要使用DataSet(DataSet是断开连接的,存储再内存中,所以资源的消耗巨大)
 使用SqlDataReader代替DataSet
 SqlDataReader是read-only,forward-only
7.关闭ASP.NET的Debug模式,部署时是再web.config中取消Debug.
8.ASP.NET输出缓冲
页面缓冲:
<% OutputCache Duration=60 VaryByParam="None"%>
   Duration=延迟时间;
   VaryByParam=控件id,例如VaryParam="TextBox1";
   切不可作无为的缓冲;
片断缓冲 :VaryByControl
asp.net新的对象Cache于Application对象具有相同的作用域
Cache.Insert("MyData",Source,new CacheDependency(Server.MapPath("authors.xml")));
绝对过期
Cache.Insert("MyData",Source,null,DataTime.Now.AddHours(1),TimeSpan.Zero);
相对过期
Cache.Insert("Mydata",Source,null,DataTime,MaxValue,TimeSpan.fromMinutes(20));


相关文档:

asp.net对图片的读写

 写图片c:\1.jpg到表cinfo中
private static void AddCinfo()
    {
        string strSql = "insert into cinfo (srvtitle,csttitle,introduction,logo) values
(@srvtitle,@csttitle,@introduction,@logo)";
        S ......

[转]ASP.NET多频道网站架构心得

asp.net多频道网站开发架构浅析 http://www.cnblogs.com/Kenny-Jiang/archive/2007/07/31/837900.html 背景:
        我们打开门户网站时,往往会看到很多排列紧密的频道列表,如“新闻”、“财经”、“娱乐”等。频道为网站提供了方便的导航功能。
内容描述:
&# ......

asp.net 页面右下角弹出类似QQ或MSN的消息提示

<HTML><HEAD>
<TITLE>网页特效观止|JsCode.CN|---页面右下角弹出类似QQ或MSN的消息提示</TITLE>
<SCRIPT language=JavaScript>
<!--
/**//*
**    ==================================================================================================
**&nbs ......

asp.net 性能

 http://blog.csdn.net/chengking/archive/2005/10/27/518079.aspx
(一).选择会话状态存储方式
    在Webconfig文件配置:
    <sessionState mode="???" stateConnectionString="tcpip=127.0.0.1:42424"
         sqlConnectionString ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号