随笔分类 -  [03]C#

摘要:直接上方法 public static ArrayList getImgUrl(string html, string regstr, string keyname) { ArrayList resultStr = new ArrayList(); Regex r = new Regex(regstr, RegexOptions.IgnoreCase); MatchCollection mc = r.Matches(html); f... 阅读全文
posted @ 2014-02-17 15:27 Xyang 阅读(900) 评论(0) 推荐(0)
摘要:1.准备XmlHelper工具类using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Xml.Serialization;using System.IO;using System.Xml;namespace QDDAL{ public static class XmlHelper { private static void XmlSerializeInternal(Stream stream, object o, Encoding e... 阅读全文
posted @ 2013-05-07 14:19 Xyang 阅读(413) 评论(0) 推荐(0)
摘要:1.SET IDENTITY_INSERT [dbo].[QD_News] ON2.插入语句3.SET IDENTITY_INSERT [dbo].[QD_News] OFF 阅读全文
posted @ 2012-04-23 16:01 Xyang 阅读(242) 评论(0) 推荐(0)
摘要:1.加载 //XML文件 private XmlDocument xmlDoc; //load xml file(加载) private void LoadXml() { xmlDoc=new XmlDocument(); xmlDoc.Load(Server.MapPath("User.xml")); }2.增加——节点 //添加节点 private void AddElement() { ... 阅读全文
posted @ 2012-03-23 14:22 Xyang 阅读(169) 评论(0) 推荐(0)
摘要:string neirong = "<table……………………s"; MailMessage mail = new MailMessage("kainengwangzhan@163.com", "public@kaineng-group.com", zhuti, neirong); mail.IsBodyHtml = true; SmtpClient smtp = new SmtpClient(); smtp.Host = "smtp.163.com"; smtp.Credentials = new Sys 阅读全文
posted @ 2012-02-15 21:34 Xyang 阅读(148) 评论(0) 推荐(0)
摘要:最近一段时间发现C盘莫名其妙的变小了,还是大幅度的变小。各种清理各种卸载还是没有。最后只能一个文件夹一个文件夹的找,结果就发现了这个莫名其妙的文件夹。VS2010下的文件夹。看了一下属性,竟然有3.5G!?what,用这么大的文件记录什么东西呢,居心何在?1.于是便上网查找了一番,基本上也没有太深入的说明,就是一般回复说可以删掉无碍。2.还是不敢贸然删掉,于是将其剪贴到一个其他地方,然后运行VS2010果然运行如初,无碍。3.问题随意解决,但是还得研究清楚点。TraceDebugging从字面上来看是跟踪调试的意思4.用VS2010将其打开,看一看到一个IntelliTrace摘要,上面记录了 阅读全文
posted @ 2012-02-14 09:12 Xyang 阅读(2641) 评论(0) 推荐(0)
摘要:设定BoundField的DataFormatString,通常有以下几种 DataFormatString= "{0:C}" 货币,货币的格式取决于当前Thread中Culture的设置 DataFormatString= "{0:E}" 科学计数法 DataFormatString= "{0: P}" 百分比 DataFormatString= "{0:F?}" 小数点后几位 DataFormatString= "{0:d}" M/d/yyyy 如 10/30/2008 DataFormat 阅读全文
posted @ 2012-02-10 16:19 Xyang 阅读(182) 评论(0) 推荐(0)
摘要:1.项目跟目录下web.config <authentication mode="Forms"> <forms protection="All" timeout="200" name="xxx" loginUrl="~/admin/Login.aspx"> </forms> </authentication>2.需要验证的目录下的web.config<?xml version="1.0"?><configura 阅读全文
posted @ 2012-02-10 15:15 Xyang 阅读(174) 评论(0) 推荐(0)
摘要:用GridView显示数据的时候往往需要对数据库中现有数据做形式上的变换。比如数据库中存的是“no”或者是“yes”而显示给用户的时候需要显示成“是”或者“否”。这个时候用RowDataBound事件来处理就比较方便了, protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { //判断数据类型 if (e.Row.RowType == DataControlRowType.DataRow) { s if (e.Row.Cells[8].Text.Trim() == "no" 阅读全文
posted @ 2012-02-10 14:55 Xyang 阅读(738) 评论(0) 推荐(0)

hi