摘要: 1 partial class Dmeos 2 { 3 public int Ager { get; set; } 4 public void Run() 5 { 6 Console.WriteLine(Ager); 7 } 8 } 9 partial class Dmeos 10 { 11 pub 阅读全文
posted @ 2018-08-03 13:40 个人天使 阅读(151) 评论(0) 推荐(0) 编辑
摘要: 1 List< long> list = new List<long>(); 2 List<Task> tList = new List<Task>(); 3 tList.Add(Task.Factory.StartNew(() => 4 { 5 for (int i = 0; i < 100; i 阅读全文
posted @ 2018-08-03 11:11 个人天使 阅读(229) 评论(0) 推荐(0) 编辑
摘要: 不用写正则表达式,用C#自带的方法 用char 自带的函数实现 1 /// <summary> 2 /// 只能由数字和大小写字母组成 3 /// </summary> 4 /// <param name="s"></param> 5 /// <returns></returns> 6 static 阅读全文
posted @ 2018-07-09 18:01 个人天使 阅读(345) 评论(0) 推荐(0) 编辑
摘要: 别人已经写过很好的XML辅助类,可以直接引用后使用; 我这里自己写一个xml的操作类,目前能实现的是对一个不含集合的类可以操作,含集合的类无法将集合里的数据读取出来, 首先定义一个XML特性,用于区分属性和标签 1 using System; 2 using System.Collections.G 阅读全文
posted @ 2018-07-09 11:01 个人天使 阅读(170) 评论(0) 推荐(0) 编辑
摘要: 做一个公用,全局共享的容器盒子,全局单利使用。 不想将数据存放在数据库,数据更新频率很高,并且只做临时存放点, 1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Reflec 阅读全文
posted @ 2018-07-06 10:43 个人天使 阅读(338) 评论(0) 推荐(0) 编辑
摘要: 将页面翻译成其它语言时,需要将页面上的中文字符检索出来 public string FindContents(string str) { string x = @"[\u4E00-\u9FFF]+"; MatchCollection Matches = Regex.Matches(str, x, R 阅读全文
posted @ 2018-06-28 17:10 个人天使 阅读(218) 评论(0) 推荐(0) 编辑
摘要: 将对象内的属性以及属性值输出 public static string ToProperties_V(this object obj) { if (obj == null) return ""; var s = obj.GetType(); StringBuilder app = new Strin 阅读全文
posted @ 2018-06-28 09:30 个人天使 阅读(179) 评论(0) 推荐(0) 编辑
摘要: 统一传输格式,对后期开发有很大的帮助,扩展也很方便。 底层数据定义格式 1 public class JsonParam 2 { 3 /// <summary> 4 /// 成功=ok ;失败=no 5 /// </summary> 6 private string status; 7 public 阅读全文
posted @ 2018-06-27 15:35 个人天使 阅读(162) 评论(0) 推荐(0) 编辑
摘要: 写了一个随机产生字符串的方法,字符串由大小字母和数字组成, 我这里利用的是GUID 作为源点,避免重复出现 /// <summary> /// /// </summary> /// <param name="leng">长度</param> public static void GenerateCh 阅读全文
posted @ 2018-06-27 15:24 个人天使 阅读(453) 评论(0) 推荐(0) 编辑
摘要: 功能分两块:1、获取页面上要翻译的内容; 2、将内容从自定义的资源包中匹配; 我的网站翻译就是在创建html页面的时候,重写其中的一个方法, 第一步:获取页面上要翻译的内容: 在MVC中由这么一个类:System.Web.Mvc.WebViewPage,他负责将我们在Razor中写的方法或属性呈现。 阅读全文
posted @ 2018-04-28 14:06 个人天使 阅读(216) 评论(0) 推荐(0) 编辑