摘要:
//删除数组元素 //数组,属性名称,属性值 function removeCodeNumList(arrPerson, objPropery, objValue) { return $.grep(arrPerson, function (cur, i) { return cur[objProper 阅读全文
摘要:
/// <summary> /// 计算地图中心点 /// </summary> /// <param name="list"></param> /// <returns></returns> private string GetCenterByList(List<BmapPo> list) { v 阅读全文
摘要:
if (!ModelState.IsValid) { List sb = new List(); //获取所有错误的Key List Keys = ModelState.Keys.ToLi... 阅读全文
摘要:
当使用EF中context.SaveChanges()的时候会报一串让查看详细信息的错误,这个错误不是真正的报错原因,如果想看真正的原因,要关掉EF的验证,如下:context.Configuration.ValidateOnSaveEnabled = false;后在调用SaveChanges()... 阅读全文
摘要:
USE master;GODECLARE @SQL VARCHAR(MAX);SET @SQL=''SELECT @SQL=@SQL+'; KILL '+RTRIM(SPID)FROM sysprocesses WHERE dbid=DB_ID('MobileDB3.1');EXEC(@SQL);GO ALTER DATABASE [MobileDB3.1] SET MULTI_USER; 阅读全文
摘要:
List转换DataTablepublic static DataTable ToDataTable(this IEnumerable results) { var resultTable = new DataTable(); var properties = typeof(T).GetProperties(); foreach (var info in properties) { var vtype = info.PropertyType; if (vtype == typeof(dou... 阅读全文
摘要:
function getUrlParam(name) { var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); var r = window.location.search.substr(1).match(reg); if (r != null) return unescape(r[2]); return null; }方法如上:利用正则调用方式为:getUrlParam('get请求的参数名') 阅读全文
摘要:
用于asp.net Mvc3中一个页面提交到不同的Actionpublic class MultiButtonAttribute : ActionNameSelectorAttribute {public string Name { get; set; }public MultiButtonAttribute(string name) {this.Name = name;}public override bool IsValidName(ControllerContext controllerContext,string actionName, System.Reflection.Method 阅读全文
摘要:
//得到cookie值的方法[STAThread] public static string RemoteLogin(string strLoginUrl, string strPostData, string cookieName) { CookieContainer cContainer=new CookieContainer(); byte[] data = System.Text.Encoding.ASCII.GetBytes(strPostData); string bResult = "";HttpWebRequest myreq = (HttpWebReque 阅读全文
摘要:
var list = new List<string> {"A", "C", "B", "D", "A", "B", "E", "D", "B", "C"}; var set = new HashSet<string>(list);foreach (string item in set) { Console.WriteLine(item); } 阅读全文