摘要: /// <summary> /// 将集合类转换成DataTable /// </summary> /// <param name="list">集合</param> /// <returns></returns> public static DataTable ToDataTable(IList list) { DataTable result = new DataTable(); if (list.Count > 0) { ... 阅读全文
posted @ 2012-07-18 20:28 jeffrey77 阅读(155) 评论(0) 推荐(0) 编辑
摘要: public IList<T> DataTableToList<T>(DataTable dataTable) { List<T> list = new List<T>(); Type targetType = typeof(T); PropertyInfo[] allPropertyArray = targetType.GetProperties(); foreach (DataRow rowElement in dataTable.Rows) { ... 阅读全文
posted @ 2012-07-18 20:22 jeffrey77 阅读(131) 评论(0) 推荐(0) 编辑
摘要: Date.prototype.format = function (format) //author: meizz { var o = { "M+": this.getMonth() + 1, //month "d+": this.getDate(), //day "h+": this.getHours(), //hour "m+": this.getMinutes(), //minute "s+": this.getSeconds(), //second "q+": Mat 阅读全文
posted @ 2012-07-13 11:37 jeffrey77 阅读(204) 评论(0) 推荐(0) 编辑
摘要: StringBuilder去除最后一个字符 :sb.Remove(sb.Length-1, 1);以“;”分隔某个字符串:string[] stringlist=str.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries);四舍五入 :Math.Round(total, 2, MidpointRounding.AwayFromZero); 阅读全文
posted @ 2012-06-12 14:19 jeffrey77 阅读(129) 评论(0) 推荐(0) 编辑
摘要: /*名称:服务器时钟(一次读取,实时显示)功能:在客户端浏览器上显示服务器端的时间。原理: 算法步骤: 1. 获取服务端的日期时间。 2. 根据客户端浏览器的时间可以得到服务器和客户端的时间差。 3. 服务器的时钟 = 客户端的时钟(变化值)+ 时间差(固定值) 这样客户端就没有必要实时的到服务器端去取时间。作者:三月三来源:http://www.cnblogs.com/march3/archive/2009/05/14/1456720.html说明: 1. 多浏览器支持 2. 由于网络延时无法估计的原因,会有一定的误差。 ... 阅读全文
posted @ 2012-06-09 15:13 jeffrey77 阅读(263) 评论(0) 推荐(0) 编辑
摘要: /// <summary> /// 将datatable装入指定类型的集合 /// </summary> /// <typeparam name="T"></typeparam> public class GenericList<T>:List<T> { public GenericList(DataTable dt, string f) { System.Type tt = System.Type.GetType(f);//获取指定名称的类型 object ff = Activat... 阅读全文
posted @ 2012-06-06 10:10 jeffrey77 阅读(669) 评论(0) 推荐(0) 编辑
摘要: public static IList<T> FillList<T>(System.Data.IDataReader reader) { IList<T> lst = new List<T>(); while (reader.Read()) { T RowInstance = Activator.CreateInstance<T>(); foreach (PropertyInfo Property in typeof(T).GetProperties()) { ... 阅读全文
posted @ 2012-06-06 10:08 jeffrey77 阅读(297) 评论(0) 推荐(0) 编辑
摘要: <?xml version="1.0"?><!--注意: 除了手动编辑此文件以外,您还可以使用 Web 管理工具来配置应用程序的设置。可以使用 Visual Studio 中的“网站”->“Asp.Net 配置”选项。设置和注释的完整列表在 machine.config.comments 中,该文件通常位于 "Windows"Microsoft.Net"Framework"v2.x"Config 中。--> <!--Webconfig文件是一个xml文件,configuration是xml 阅读全文
posted @ 2012-06-06 09:48 jeffrey77 阅读(172) 评论(0) 推荐(0) 编辑
摘要: 当table中没有内容时,列的边框会显示不出来。下面的设置可以解决该问题。table{ border-collapse:collapse;}table td{ empty-cells:show;} 阅读全文
posted @ 2012-05-29 17:36 jeffrey77 阅读(539) 评论(0) 推荐(0) 编辑
摘要: 一台加入到 ActiveDirectory(活动目录 – AD,注:WinSRV2008)的 Windows 7 客户端,使用 Remote Desktop 登录 AD 内部的计算机时能够使用已保存的凭据进行自动验证。但是 AD 外部的计算机即使保存了登录凭据,在连接时仍然会提示输入密码,如下图所示:Remote Desktop 会提示“系统管理员不允许使用保存的凭据登录远程计算机,原因是未完全验证其标识。请输入新凭据。”!这是出于安全考虑的设计,当然我们可以进行修改使加入到 AD 内的系统能够保存 AD 外部计算机的凭据。为此,在运行中输入 gpedit.msc,启动本地组策略编辑器。定位到 阅读全文
posted @ 2012-05-09 10:11 jeffrey77 阅读(684) 评论(0) 推荐(0) 编辑