yqm的.net之园

writing down what i am experiencing or creating

2008年7月4日

使用XmlReader类

摘要: 1.创建XmlReader对象 XmlReader是一个抽象类,所以,要使用XmlReader类,必须使用静态方法Create,该方法返回一个XmlReader对象。Crate方法有许多重装版本,最常用的是,使用字符串参数,输入一个XmlDocument的文件名。另外一个是基于流创建。 2.Read方法 遍历文档。代码: 1XmlReader reader = XmlReader.Create(... 阅读全文

posted @ 2008-07-04 23:48 YQM 阅读(472) 评论(0) 推荐(0) 编辑

2008年6月11日

知道做什么而不是怎样做(摘抄)

摘要: 很多初级程序员问我“我怎样做这个,或者我怎样做那个?”我总是会跟他们说“你想做什么呢?”听闻此言后,他们会死盯着我,就好像我跟他们的妈妈约会了一 样。这就是我的下一个观点,绝不要在知道你想做什么之前去学习怎样做,比如一个程序员想要搜索一个文本文件中是否存在的某个特定的词汇。下面是用C#来实 现该目的: Code highlighting produced by Actipro CodeHigh... 阅读全文

posted @ 2008-06-11 13:21 YQM 阅读(243) 评论(0) 推荐(0) 编辑

2008年5月20日

生活15点,要记住!

摘要: 1、说话要用脑子,做事慎言,话多无益,嘴只是一件扬声器而已,平时一定要注意监督,控制好调频旋钮和音控开关,否则会给自己带来许多麻烦。讲话不要只顾一时痛快,信口开河,以为人家给你笑脸就是欣赏,没完没了的把掏心窝子的话都讲出来,结果让人家彻底摸清了家底。还偷着笑你。 2、遇事不要急于下结论,即便有了答案也要等等,也许有更好的解决方式,站在不同的角度就有不同答案,要学会换位思维,特别是在遇到麻烦... 阅读全文

posted @ 2008-05-20 15:35 YQM 阅读(177) 评论(0) 推荐(0) 编辑

2008年5月19日

设计模式之Command模式

摘要: namespace DesignPattern { public interface ILogWriter { void Write(string target, string logValue); } public class TxtLogWriter : ILogWriter { ILogWriter Members#re... 阅读全文

posted @ 2008-05-19 20:22 YQM 阅读(141) 评论(0) 推荐(0) 编辑

2007年7月29日

使用javascript动态添加和删除table的行和列

摘要: 第一种方法:使用insertRow添加行,使用insertCell添加单元格,再用innerHTML填充单元格。使用deleteRow删除行,代码如下:Javascript代码: function addRow() { var root = document.getElementById("tbody") var allRows = root.getElementsByTagNa... 阅读全文

posted @ 2007-07-29 14:40 YQM 阅读(21606) 评论(2) 推荐(0) 编辑

2007年5月26日

Generate unique strings and numbers in C#(生成一个唯一的字符串和数值)

摘要: The System.Guid is used whenever we need to generate a unique key, but it is very long. That's in many cases not an issue, but in a web scenario where it is part of the URL we need to use its string r... 阅读全文

posted @ 2007-05-26 17:15 YQM 阅读(475) 评论(0) 推荐(0) 编辑

2007年4月28日

Some notes

摘要: 获取当前日期的月份名称: string TheStartMonth = System.Globalization.DateTimeFormatInfo.CurrentInfo.GetMonthName(TheStartDate.Month); 当vs打不开设计视图时,试试这个: start-->run:devenv /ResetSkipPkgs Request.QueryString["... 阅读全文

posted @ 2007-04-28 20:56 YQM 阅读(249) 评论(0) 推荐(0) 编辑

2007年4月8日

Localization in ASP.NET 2.0

摘要: 本地化应用程序,猜想作者是一个中国人.The Web is an international place. Why shouldn't your websites be ready for international visitors? Isn't that was the first two Ws ("World" and "Wide") in WWW are for? With the int... 阅读全文

posted @ 2007-04-08 12:15 YQM 阅读(154) 评论(0) 推荐(0) 编辑

2007年3月23日

ASP.NET 2.0: Playing a bit with GridView "Sort Grouping"

摘要: very cool.可以按照某个字段进行分类显示。挺实用。作者研究gridview彻底。 I am on bit experiment mood today, so I did a little tryout to see what it requires to add so called "sort grouping" into GridView. E.g when you have tabul... 阅读全文

posted @ 2007-03-23 13:55 YQM 阅读(254) 评论(0) 推荐(0) 编辑

2007年3月16日

通过TryParse来检验和转换数据类型

摘要: 2005中每种类型都提供了TryParse方法,该方法的格式一般为bool TryParse(value,out resultValue)。value 就是将要转换的数据,resultValue是转换后的值。该方法若成功,resultValue中将是转换后的值,同时方法返回true;若失败,resultValue将是将要转换的类型的默认值,同时方法返回false。 if (int.TryParse... 阅读全文

posted @ 2007-03-16 00:49 YQM 阅读(251) 评论(0) 推荐(0) 编辑