博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理
上一页 1 ··· 9 10 11 12 13 14 15 16 17 ··· 20 下一页

2009年3月16日

摘要: //获得字符串oString的实际长度public int StringLength(string oString){byte[] strArray=System.Text .Encoding.Default .GetBytes (oString);int res=strArray.Length ;return res;} 阅读全文

posted @ 2009-03-16 16:43 ^_^木头人 阅读(153) 评论(0) 推荐(0)

摘要: 字符型转换 转为字符串 12345.ToString("n"); //生成 12,345.00 12345.ToString("C"); //生成 ¥12,345.00 12345.ToString("e"); //生成 1.234500e+004 12345.ToString("f4"); //生成 12345.0000 12345.ToString("x"); /... 阅读全文

posted @ 2009-03-16 16:43 ^_^木头人 阅读(91) 评论(0) 推荐(0)

摘要: 截取字串的一部分,参数1为左起始位数,参数2为截取几位。 如:string s1 = str.Substring(0,2); 阅读全文

posted @ 2009-03-16 16:43 ^_^木头人 阅读(232) 评论(0) 推荐(0)

摘要: 当文件在不同目录下,需要获取数据库连接字符串(如果连接字符串放在Web.config,然后在Global.asax中初始化) 在Application_Start中添加以下代码: Application["ConnStr"]=this.Context.Request.PhysicalApplicationPath+ConfigurationSettings.AppSettings [... 阅读全文

posted @ 2009-03-16 16:43 ^_^木头人 阅读(92) 评论(0) 推荐(0)

摘要: 将时间格式化:string aa=DateTime.Now.ToString("yyyy年MM月dd日"); 取当前年月日时分秒 currentTime=System.DateTime.Now; 取当前年 int 年= DateTime.Now.Year; 取当前月 int 月= DateTime.Now.Month; 取当前日 int ... 阅读全文

posted @ 2009-03-16 16:43 ^_^木头人 阅读(169) 评论(0) 推荐(0)

摘要: 先定义变量 :public static int pageCount; //总页面数 public static int curPageIndex=1; //当前页面 下一页: if(DataGrid1.CurrentPageIndex 0) { DataGrid1.CurrentPageIndex += 1; curPageIndex-=1; } bind(); // D... 阅读全文

posted @ 2009-03-16 16:43 ^_^木头人 阅读(87) 评论(0) 推荐(0)

摘要: HttpUtility.HtmlEncode(string) HttpUtility.HtmlDecode(string) 阅读全文

posted @ 2009-03-16 16:43 ^_^木头人 阅读(162) 评论(0) 推荐(0)

摘要: C#基础概念二十五问 1.静态变量和非静态变量的区别? 2.const 和 static readonly 区别? 3.extern 是什么意思? 4.abstract 是什么意思? 5.internal 修饰符起什么作用? 6.sealed 修饰符是干什么的? 7.override 和 overload 的区别? 8.什么是索引指示器? 9.new 修饰符是起什么作用? 10.this 关键... 阅读全文

posted @ 2009-03-16 16:43 ^_^木头人 阅读(83) 评论(0) 推荐(0)

摘要: 验证控件经常失效 iis没有添加axd扩展.在iis里的网站属性里添加 可执行文件:C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/aspnet_isapi.dll 扩展名:.axd 限制为:GET,HEAD,POST,DEBUG 并且去除“确认文件是否存在”的勾。 阅读全文

posted @ 2009-03-16 16:43 ^_^木头人 阅读(104) 评论(0) 推荐(0)

摘要: 1.右击【我的电脑】→【属性】→【高级】→【环境变量】→【新建用户环境变量】变量名:CORPATH变量值:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\ 2.保存下面代码为.bat文件%CORPATH%aspnet_compiler -v /website -p D:\MyProject\bbc007\www\ -f D:\compiled\bbc0... 阅读全文

posted @ 2009-03-16 16:43 ^_^木头人 阅读(240) 评论(0) 推荐(0)

上一页 1 ··· 9 10 11 12 13 14 15 16 17 ··· 20 下一页