摘要:
this.Invoke(new MethodInvoker(() => { //TO DO })); this.Invoke(new Action(()=>{ // TO DO })); 阅读全文
摘要:
[STAThread] static void Main() { if (Environment.OSVersion.Version.Major >= 6) SetProcessDPIAware(); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderi... 阅读全文
摘要:
/* 正则验证 */ /// /// 返回与模式字符串匹配的值 /// /// 输入字符串 /// 模式字符串 /// public static string Match(this string input, string pattern) { return input.IsNullOrEmpty() ? null : Regex.Match(input, pattern).Value;... 阅读全文
摘要:
using System; using System.Collections; using System.Xml; namespace Services.Tool { public class XmlHelper { #region 公共变量 public static XmlDocument xmldoc; public stat... 阅读全文
摘要:
/// /// 获取WebBrowser指定的图片 /// /// 需要获取图片的WebBrowser /// 指定的图片的id(优先查找指定id) /// 指定的图片的src,支持模糊查询 /// 指定的图片的src, 支持模糊查询 /// public static Image GetRegCodePic(ref WebBrowser w... 阅读全文
摘要:
namespace System { /// /// 为指定的实例创建有线程安全的单例模式。实例必须有一个公开的,无参数的构造方法,并且能正确的被实例化。 /// /// 作为单例的对象。 public static class Singleton where T : class { static volatile... 阅读全文
摘要:
/// /// /// 将实体类/匿名对象转换为SqlParameter列表 /// 示例1: 实体类 /// EntityClass entityClass = new EntityClass(){ Id = 1 , Name="名称"}; SqlParameter[] parms = entityClass.ToSqlParameterArray() /// 示例2: 匿名对象 /// ... 阅读全文
摘要:
protected override void OnModelCreating(DbModelBuilder modelBuilder) { modelBuilder.Entity().Property(p => p.ID) .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None); } 也可以通过在实体类属性上加标记实现: publ... 阅读全文
摘要:
System.Text.RegularExpressions.MatchCollection ms = System.Text.RegularExpressions.Regex.Matches(ecarvoText, "\\\"[a-zA-Z0-9]+\\\"\\s*:"); foreach (System.Text.RegularExpressions.... 阅读全文
摘要:
static string ReturnData(int resultCode, string resultMessage = "", string resultData = "") { return JObject.FromObject(new { resultCode = resultCode, ... 阅读全文