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

ASP.NET 页面数据校验类 李天平老师写的,很好的


    using System.Text.RegularExpressions;
 
/// <summary>
    /// 页面数据校验类
    /// 李天平
    /// 2004.8
    /// </summary>
    public class PageValidate
    {
        private static Regex RegNumber = new Regex("^[0-9]+$");
        private static Regex RegNumberSign = new Regex("^[+-]?[0-9]+$");
        private static Regex RegDecimal = new Regex("^[0-9]+[.]?[0-9]+$");
        private static Regex RegDecimalSign = new Regex("^[+-]?[0-9]+[.]?[0-9]+$"); //等价于^[+-]?\d+[.]?\d+$
        private static Regex RegEmail = new Regex("^[\\w-]+@[\\w-]+\\.(com|net|org|edu|mil|tv|biz|info)$");//w 英文字母或数字的字符串,和[a-zA-Z0-9] 语法一样
        private static Regex RegCHZN = new Regex("[\u4e00-\u9fa5]");
        public PageValidate()
        {
        }
        #region 数字字符串检查
        /// <summary>
        /// 检查Request查询字符串的键值,是否是数字,最大长度限制
        /// </summary>
        /// <param name='req'>Request</param>
        /// <param name='inputKey'>Request的键值</param>
        /// <param name='maxLen'>最大长度</param>
        /// <returns>返回Request查询字符串</returns>
        public static string FetchInp


相关文档:

ASP.NET 2.0网站优化技巧总结

1. 当不需要使用Session的时候请关闭
        关闭Session当不需要使用的时候
• 若要禁用页的会话状态,请将@ Page 指令中的EnableSessionState 属性设置为false。例如, <%@ Page EnableSessionState="false" %>。
• 注意如果页需要访问会话变量,但不打算创建或修改它们,则将 ......

ASP.NET实现在线播放FLV视频件的代码

ASP.NET实现在线播放FLV视频件的代码
 
前台调用代码
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html
xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1&q ......

ASP.NET读取EXCEL文件的三种方法


1.方法一:采用OleDB读取EXCEL文件:
把EXCEL文件当做一个数据源来进行数据的读取操作,实例如下:
public DataSet ExcelToDS(string Path)
{
string strConn = "Provider=Microsoft.Jet.OLEDB.4.0;" +"Data Source="+ Path +";"+"Extended Properties=Excel 8.0;";
OleDbConnection conn = new OleDbConnection(str ......

ASP.NET执行存储过程,并获取存储过程的返回值

//连接数据库
        string myStr = CODE.DbHelperSQL.connectionString;
        SqlConnection myConn = new SqlConnection(myStr);
        myConn.Open();
      &nbs ......

ASP.NET Routing for URLRewriting with QueryStrings

In the last post I showed how to use the ASP.NET 3.5 Routing Engine
for URLRewriting purposes. I want to go further in this post by adding
the ability to add variables into a route path and forward and append
query string variables to the destination Web Form request.
A route can contain one or ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号