asp.net验证一个字符串是否符合指定的正则表达式
/// /// 快速验证一个字符串是否符合指定的正则表达式。 /// /// 正则表达式的内容。 /// 需验证的字符串。 /// 是否合法的bool值。 public static bool QuickValidate(string _express, string _value) {if (
/// /// 快速验证一个字符串是否符合指定的正则表达式。 /// /// 正则表达式的内容。 /// 需验证的字符串。 /// 是否合法的bool值。 public static bool QuickValidate(string _express, string _value) {if (
/// /// 获取querystring /// /// 参数名 /// 返回值 public string q(string s) {if (Request.QueryString[s] != null){return Request.QueryString[s].ToString();}r
/* - - - - - - - - - - - - - - - - - - - - - - - -* Stream 和 byte[] 之间的转换* - - - - - - - - - - - - - - - - - - - - - - - */ /// /// 将 Stream 转成 byte[
using System;using System.Text.RegularExpressions;namespace CommonTools{/**//// /// RegexLib 的摘要说明。/// public class RegexLib{//验证Email地址public static
using System; using System.Data; using System.Data.SqlClient;namespace SysClassLibrary { /// /// DataAccess 的摘要说明。 /// 数据处理基类,调用方式:DataAccess.DataSet
实现代码如下: /// /// 得到真实IP以及所在地详细信息(Porschev) /// /// public string GetIpDetails() { //设置获取IP地址和国家源码的网址 string url = "http://www.ip138.com/ips8.asp"; s
实现代码如下: using System; using System.Data; using System.Configuration; using System.Web; using System.Web.Security; using System.Web.UI; using System.We
因此需要以下函数做转换: 实现代码如下: /// ///替换html中的特殊字符 /// ///需要进行替换的文本。 ///替换完的文本。 public static string HtmlEncode(string theString) { theString=theString.Replace(
(一)普通列 实现代码如下: /// /// Gridview列的合并(普通列,不包含模板列) /// 注意:1.GridView在绑定的时候进行分组和排序,才能让相同的行放在一起 /// 2.方法应用的时机,应该在Gridview的DataBound事件中使用 /// /// 需要合并的Gri
实现代码如下: /// /// List转换成DataSet /// /// 类型 /// 将要转换的List /// public DataSet ConvertToDataSet(IList list) { if (list == null || list.Count <= 0) {