JavaScript通过ID获取元素坐标 function getElementPos(elementId) { var ua = navigator.userAgent.toLowerCase(); var isOpera = (ua.indexOf('opera') != -1); var isIE = (ua.indexOf('msie') != -1 && !isOpera); // not opera spoof var el = document.get
关键代码: using System; using System.Collections; using System.Collections.Generic; using System.ComponentModel; using System.Reflection; namespace CSharpUtilHelpV2 { /// <summary> /// 基于.NET 2.0的枚举工具类 /// </summary> public static class EnumToolV2
/// <summary> /// 获取枚举Description的Name /// </summary> /// <param name="enumName">枚举</param> /// <returns></returns> public static string GetDescription(Enum enumName) { var name = enumName.ToString(); var type
//把一个对象转换成功键值对字典格式 var obj = new { CustomerId = customerId }; var dic = obj.ToDictionray(); public static class ObjectExtension { public static Dictionary<string, object> ToDictionary(this object obj) { if (obj == null) r