随笔分类 - C#
摘要:/*Converts List To DataTable*/ public static DataTable ToDataTable(IList data) { DataTable dataTable = new DataTable(typeof ...
阅读全文
摘要:虽然.NET已经是现实了Reverse(),但是学习算法有必要知道其是怎么实现的:private static void ReverseArray(int[] array) { int temp; int count = array.Leng...
阅读全文
摘要:LINQvar str= str.ToCharArray() .GroupBy(x => x) .OrderByDescending(x => x.Count()) ....
阅读全文
摘要:internal class CacheHelper { /// /// Insert value into the cache using /// appropriate name/value pairs /// //...
阅读全文
摘要:/// /// 获取枚举Description的Name /// /// 枚举 /// public static string GetDescription(Enum enumName) { var name = enumName.ToString(); var type = enumName.GetType(); var fieldInfo = type.GetField(name); var arrDesc = (DescriptionAttribute[])fieldInfo.GetCustomAttributes(typeof(DescriptionAt...
阅读全文
摘要:<!-- JiaThis Button BEGIN --> <div id="ckepop"> <a class="jiathis_button_renren"></a><a class="jiathis_button_tsina"></a><a class="jiathis_button_tqq"> </a><a class="jiathis_button_douban"></a&
阅读全文
摘要:Convert.ToDateTime("2013/04/16 00:00:00.000").ToString("yyyy-MM-dd");
阅读全文
摘要:比如在2010中打开2012的项目1,用记事本打开sln文件2,将修改为11.00和2010保存即可用vs2010打开2012的项目了
阅读全文
摘要:url重写的好处:1,方便搜索引擎检索到(html格式的网站搜索引擎记住的优先级最高,seo优化更好)2,url更加简洁,方便用户记忆3,隐藏网页的实际路劲和具体开发技术使用URLRewriter.dll重写使用URLRewriter.dll后,只需要使用如下步骤将可以进行url重写1,在webconfig下写入 <Rules> <!-- 规则1 --> <RewriterRule> <LookFor>~/d(\d+)\.html </LookFor> <SendTo>~/default.aspx?id=$1 </S
阅读全文
摘要:public static string DislodgeHtml(string strHtml){string[] aryReg ={@"<script[^>]*?>.*?</script>",@"<(\/\s*)?!?((\w+:)?\w+)(\w+(\s*=?\s*(([""'])(\\[""'tbnr]|[^\7])*?\7|\w+)|.{0})|\s)*?(\/\s*)?>",@"([\r\n])[\s]+",@"&a
阅读全文