![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
经验总结
猿序程
这个作者很懒,什么都没留下…
展开
-
IIS程序池应用于不同net framework版本时引发的问题(Server Application Unavailable)
配置IIS5.0的时候,如果站点A的ASP.NET版本是net framework 4.0,使用程序池C。站点B是net framework 2.0,使用的程序池也是C。那么很容易出现Server Application Unavailable错误。所以一个程序池不要共同应用于不同ASP.NET版本的站点。同版本的可以!原创 2015-02-26 13:42:44 · 1305 阅读 · 0 评论 -
ASP.NET页面引入用户控件
原创 2015-06-09 11:23:38 · 737 阅读 · 0 评论 -
repeater绑定时获取HTML形式的控件
HtmlInputText htmlInput = (HtmlInputText)e.Item.FindControl("txtName"); 其他形式的单选或者复选,修改相应的HtmlInputText就可以了原创 2015-12-01 14:55:07 · 1433 阅读 · 1 评论 -
MD5加密
password = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(password, "MD5").ToLower(); //md5加密原创 2016-02-03 10:26:09 · 346 阅读 · 0 评论 -
c#使用正则表达式
1.定义正则表达式private static Regex RegCHZN = new Regex("^[\u4e00-\u9fa5]+$"); //验证是否是中文2.使用正则表达式Match m = RegCHZN.Match(需要验证的参数); return m.Success; //true为匹配成功;false为匹配失败原创 2016-03-04 09:31:52 · 352 阅读 · 0 评论 -
JS使用正则表达式
1.定义正则表达式var myReg = /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/; //验证是否是邮件2.使用正则表达式if(myReg.test(需要验证的值)){//true匹配成功}else{//false匹配失败}原创 2016-03-17 17:57:13 · 339 阅读 · 0 评论 -
数据库备份语句
BACKUP DATABASE [WebDB] TO DISK = 'D:\BACKUP\WebDb.bak' WITH INIT , NOUNLOAD , NAME = N'WebDB的备份说明?', NOSKIP , STATS = 10, NOFORMAT 如果需要自动备份,那么就在数据库作业里面定时执行此存储过程,eg:exec backDb原创 2015-07-24 17:28:41 · 1778 阅读 · 0 评论 -
从指定的数组中,随机抽取一个数
int[] arrViewCount = new int[] { 1, 3, 5, 7, 9, 2, 4, 6, 8 }; Random r = new Random();int n = r.Next(0, arrViewCount.Length - 1);Response.Write(arrViewCount[n].ToString());原创 2016-08-02 18:05:11 · 11918 阅读 · 0 评论 -
字符中\的转义
一般字符串中的\都是写两遍\\来实现转义,但是其实在字符串前面加一个@,就可以单写一个\了。例子如下:string path = @"E:\upload\test.txt";string path2 = "E:\\upload\\test.txt";原创 2016-10-17 17:35:58 · 1222 阅读 · 0 评论 -
C#调用HTTP接口
string url = "http://jiekou.56dxw.com/sms/HttpInterface.aspx?comid=123&username=test&userpwd=*****"; WebRequest wRequest = WebRequest.Create(url); WebResponse wResponse = wRequ原创 2015-02-26 12:58:54 · 19479 阅读 · 2 评论 -
Gridview中OnRowCommand获取值
方法一:最好的方法是使用e.CommandArgument方法二:寻找控件方法 GridViewRow row = ((Control)e.CommandSource).BindingContainer as GridViewRow; HiddenField strCreateTime = (HiddenField)row.FindContro原创 2016-12-14 18:10:01 · 2212 阅读 · 0 评论 -
GridView、DataGrid使用DataBound事件前提
1.GridViewif (e.Row.RowType == DataControlRowType.DataRow){ //...}2.DataGridif (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem){ //...}原创 2017-02-22 15:18:56 · 991 阅读 · 0 评论 -
在域名中检索内容(site)
site:域名 关键字 (在指定域名内搜索指定的关键字)site:域名 (查看搜索引擎已经收录你网站的网页)domain:域名 (查看哪些网站中含有你的网站的域名)eg:site:www.lansezhihui.com 北京原创 2017-02-14 10:56:58 · 1671 阅读 · 0 评论 -
++i与i++的区别
++i 先赋值,后执行i++ 先执行,后赋值原创 2017-02-14 11:28:37 · 490 阅读 · 0 评论 -
在绑定repeater时,获取值
DataBinder.Eval(e.Item.DataItem, "Id");原创 2015-07-16 16:49:38 · 786 阅读 · 0 评论 -
工作中遇到的程序小结
1.获取汉字的字节长度int count = Encoding.Default.GetByteCount("你好"); //原创 2014-05-28 17:23:46 · 953 阅读 · 0 评论 -
c#使用正则表达式
Regex.IsMatch("需验证的字符串", @"^[a-z]{01,12}$");原创 2015-07-23 11:54:31 · 350 阅读 · 0 评论 -
c#休眠
System.Threading.Thread.Sleep(1000); //休眠一秒原创 2015-07-16 16:47:03 · 6384 阅读 · 0 评论 -
aspx页面导入命名空间
原创 2015-07-16 16:43:42 · 2319 阅读 · 0 评论 -
c#获取汉字的字节长度
int count = Encoding.Default.GetByteCount("你好"); //输出4原创 2015-07-16 16:42:15 · 2415 阅读 · 0 评论 -
类库调用Response
HttpContext.Current.Response原创 2015-07-16 16:45:05 · 1097 阅读 · 0 评论 -
获取web.config里key值
ConfigurationManager.AppSettings["key"]原创 2015-07-16 16:46:14 · 3196 阅读 · 0 评论 -
SQL查询的时候可自带循环
select t1.*,(select title from Table2 where id=t1.id) as newTitlefrom Table1 t1原创 2015-08-06 18:01:53 · 2312 阅读 · 0 评论 -
SQL计算百分比
select CONVERT(decimal(18, 1),除数 * 1.0 / 被除数) * 100 a from 表名decimal(18, 1) 代表取一位小数原创 2015-08-26 17:33:12 · 28343 阅读 · 5 评论 -
ASP.NET动态创建Media标签
System.Web.UI.HtmlControls.HtmlMeta metaKeywords = new System.Web.UI.HtmlControls.HtmlMeta(); metaKeywords.Name = "keywords"; metaKeywords.Content = keywords + "," + config.Web原创 2014-10-09 12:17:21 · 610 阅读 · 0 评论 -
Split
string strs = "张三@@李四@@王五";string[] arrStr = strs.Split(new string[] { "@@" }, StringSplitOptions.None);原创 2014-07-04 16:11:15 · 507 阅读 · 0 评论 -
.NET的一些指令
1.@ Assembly"WJCMS.Model" %>原创 2014-06-11 11:12:06 · 588 阅读 · 0 评论 -
图片加载失败,显示默认图片
原创 2015-07-30 16:11:27 · 2330 阅读 · 0 评论 -
ASP.NET页面修改模板页Title、SeoKeywords、SeoDescription
cs Master.Page.Title = article.articleTitle; Master.Page.MetaKeywords = "keywords"; Master.Page.MetaDescription = "fdfdfdf";原创 2014-10-09 11:58:44 · 1037 阅读 · 0 评论 -
NET获取汉字的字节长度
int count = Encoding.Default.GetByteCount("你好"); //输出4原创 2015-08-14 09:29:44 · 1173 阅读 · 0 评论 -
关闭不安全的HTTP方法
在web.config----节点内添加如下代码: 以上代码只允许开启GET、POST和HEAD方法。说明:allowUnlisted="false":拒绝未列出的谓词。原创 2016-02-17 11:11:20 · 4514 阅读 · 2 评论