随笔分类 - C#
摘要:public string GetModelValue(string FieldName, object obj) { try { Type Ts = obj.GetType(); object o = Ts.GetProperty(FieldName).GetVal...
阅读全文
摘要://获取客户端计算机名称 System.Net.IPAddress clientIP = System.Net.IPAddress.Parse(Request.UserHostAddress);//根据目标IP地址获取IP对象 System.Net.IPHostEntry ihe = System.Net.Dns.GetHostEntry(cl...
阅读全文
摘要:https://files.cnblogs.com/files/gaocong/csprjDistinct.rar
阅读全文
摘要:使用: List<string> list = new List<string>(); list.Add("1"); list.Add("1"); list.Add("2"); list.Add("1"); list.Add("3"); list.Add("3"); Purge(ref list);
阅读全文
摘要:调用 string path = @"..\..\upload\demo.xml"; distinct(path);
阅读全文
摘要:public ActionResult Index() { XDocument doc = XDocument.Load(@"G:\users\kim.gao\documents\visual studio 2015\Projects\test\test\test.csproj"); ContainFileToCsproj(@...
阅读全文
摘要:/// /// 物理路径转网络路径 /// /// /// public string urlconvertor(string path) { string tmpRootDir = HttpContext.Current.Server.MapPath(Syst...
阅读全文
摘要:public class RouteConfig { private static string[] namespaces = new string[1] { "Best.Site.Areas.BestPalace" }; public static void RegisterRoutes(RouteCollection routes) ...
阅读全文
摘要:1.nuget安装依赖 2.配置注入规则(Global.asax) crud注入Controller //基于SqlSugarOrm的依赖注入: interface: //实现类 在控制器中的注入: CRUD: //interface //实现类
阅读全文
摘要:ActivationContext ac = AppDomain.CurrentDomain.ActivationContext; ApplicationIdentity ai = ac.Identity; Console.WriteLine("Full name = " + ai.FullName); Console.WriteLine("Code base = " + ai.CodeBase...
阅读全文
摘要:解决方法: require("!style-loader!css-loader!./style.css"); require("!style-loader!css-loader!./style.css");
阅读全文
摘要:using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Diagnostics; namespace setIp { public class Command { /**/ /// /// ...
阅读全文
摘要:HttpWebResponse res = null; try { res = request.GetResponse() as HttpWebResponse; } catch (WebException ex) { res = (HttpWebResponse)...
阅读全文
摘要:CookieCollection cookList = new CookieCollection(); cookList.Add(new Cookie("cf_clearance", "31233dc649a45d559ab4f624eba501646d9a7c8a-1492325756-57600", "/", ".taokemiao.com"));
阅读全文
摘要:/// /// 时间戳与DateTime互转 /// public class UnixOfTimeHelper { /// /// 时间转unix时间戳 /// /// 北京时间1970-01-01 08:00:00 /// public static ...
阅读全文