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

ASP.NET C# 生成静态页面简单方法

ASP.NET C# 生成静态页面简单方法
 
//源码是替换掉模板中的特征字符
            string mbPath = Server.MapPath("template.html");
            Encoding code = Encoding.GetEncoding("gb2312");
            StreamReader sr = null;
            StreamWriter sw = null;
            string str = null;
            //读取
            try
            {
                sr = new StreamReader(mbPath, code);
                str = sr.ReadToEnd();
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                sr.Close();
            }
    &n


相关文档:

ASP.NET取网页数据《数据采集》


using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.IO;
using Sy ......

有效提高ASP.NET性能的十个优化方法


1. 数据库访问性能优化
数据库的连接和关闭
访问数据库资源需要创建连接、打开连接和关闭连接几个操作。这些过程需要多次与数据库交换信息以通过身份验证,比较耗费服务器资源。ASP.NET中提供了连接池(Connection Pool)改善打开和关闭数据库对性能的影响。系统将用户的数据库连接放在连接池中,需要时取出,关闭时收回 ......

ASP.NET中防止页面多次提交的代码实现

此处提供的代码用来实现当asp.net页面中的某个Button被点击后disable掉该页面中所有的Button,从而防止提交延时导致的多次提交。基于之前的onceclickbutton脚本.
//ASP.NET中防止页面多次提交的代码:javascript< script language="javascript"> < !-- function disableOtherSubmit() {
var obj = event.srcElem ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号