12 2011 档案
一个月的第一天和最后一天
摘要:DateTime beginMDate = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1);DateTime endMDate = beginMDate.AddMonths(1).AddDays(-1); 阅读全文
posted @ 2011-12-28 18:05 张扬个性,敢为天下先 阅读(502) 评论(2) 推荐(1)
文本框设置只读,后台可获取
摘要:有时候前台只希望用户查看不希望修改,但是后台又需要获取的到这个信息如下方面:前台文本框设置ReadOnly <asp:TextBoxID="TextBox1"runat="server"ReadOnly="True"></asp:TextBox>后台用Request获取, stringText=Request.Form["TextBox1"].Trim(); 阅读全文
posted @ 2011-12-27 10:13 张扬个性,敢为天下先 阅读(703) 评论(0) 推荐(0)
在标签中添加属性
摘要:JSdocument.getElementById('ID').属性="属性内容"; document.getElementById('txt1').readOnly="readonly"; 添加只读jq&("#ID").attr("属性","属性内容").NETthis.ID.Attributes.Add("onfocus","this.blur();"); 阅读全文
posted @ 2011-12-20 09:31 张扬个性,敢为天下先 阅读(1059) 评论(0) 推荐(0)
select中case-when-then用法
摘要:selectcasewhen 1>0 then '1'when 1<0 then '0'else '0'end记住最后要加end 阅读全文
posted @ 2011-12-19 11:48 张扬个性,敢为天下先 阅读(1684) 评论(0) 推荐(0)
执行SQL脚本语句判断是否已经存在
摘要:1.字段是否存在if((select count(*) from syscolumns where name = '字段名' and id=(select id from sysobjects where name='表名'))=0)beginend2.表是否存在if exists (select * from sysobjects where id = OBJECT_ID('表名') and OBJECTPROPERTY(id, 'IsUserTable') = 1) DROP TABLE 表名 阅读全文
posted @ 2011-12-12 09:57 张扬个性,敢为天下先 阅读(794) 评论(0) 推荐(0)
js 读取JSON值
摘要:{"AreaMax":{ "schema":[ {"name":"AREA","type":"string"}, {"name":"ADCD","type":"string"}, {"name":"VAL","type":"decimal"}, {"name":"STNM",&q 阅读全文
posted @ 2011-12-08 16:48 张扬个性,敢为天下先 阅读(1472) 评论(0) 推荐(0)
编译后网站更新新文件--注意事项
摘要:1.后台CS代码有修改必须替换,编译后生成dll文件覆盖原来的DLL2.前台页面修改,所修改的问题也需要替换; 阅读全文
posted @ 2011-12-07 15:26 张扬个性,敢为天下先 阅读(359) 评论(2) 推荐(0)
推荐一款生成SQL插入语句的软件
摘要:软件:SqlDataToScript生成需要插入的表的数据 阅读全文
posted @ 2011-12-07 10:15 张扬个性,敢为天下先 阅读(428) 评论(0) 推荐(0)
正则匹配代码
摘要:Regex rx = new Regex(@"(\d+).\x20target...blank.\x20{1,5}style=.LINE-HEIGHT:150%.>", RegexOptions.Compiled | RegexOptions.IgnoreCase); MatchCollection _oMatchColl = rx.Matches(weatherhtml); string str = string.Empty; foreach (Match match in _oMatchColl) { GroupCollection groups = match. 阅读全文
posted @ 2011-12-01 09:50 张扬个性,敢为天下先 阅读(413) 评论(0) 推荐(0)
采集网页代码
摘要:string weatherhtml = string.Empty; HttpWebRequest webrt = (HttpWebRequest)WebRequest.Create("http://www.fjqx.gov.cn"); HttpWebResponse webrs = (HttpWebResponse)webrt.GetResponse(); //读取数据 Stream stream = webrs.GetResponseStream(); StreamReader srm = new StreamReader(stream, System.Text.Enc 阅读全文
posted @ 2011-12-01 08:52 张扬个性,敢为天下先 阅读(557) 评论(0) 推荐(0)