摘要: 一、校验数字的表达式 1 数字:^[0-9]*$ 2 n位的数字:^\d{n}$ 3 至少n位的数字:^\d{n,}$ 4 m-n位的数字:^\d{m,n}$ 5 零和非零开头的数字:^(0|[1-9][0-9]*)$ 6 非零开头的最多带两位小数的数字:^([1-9][0-9]*)+(.[0-9] 阅读全文
posted @ 2019-01-15 15:37 做而不求 阅读(400) 评论(0) 推荐(0) 编辑
摘要: using System.Windows.Media; 1、String转换成Color Color color = (Color)ColorConverter.ConvertFromString(string); 2、String转换成Brush BrushConverter brushConve 阅读全文
posted @ 2018-12-17 11:04 做而不求 阅读(4274) 评论(0) 推荐(0) 编辑
摘要: //定义可序列化Dictionary类 [Serializable] public class SerializableDictionary<TKey, TValue> : Dictionary<TKey, TValue>, IXmlSerializable { public Serializabl 阅读全文
posted @ 2018-12-10 15:52 做而不求 阅读(240) 评论(1) 推荐(0) 编辑
摘要: wsHttpBinding,Massage UserName认证 阅读全文
posted @ 2018-12-08 23:30 做而不求 阅读(713) 评论(0) 推荐(0) 编辑
摘要: 找到vs安装目录下的:C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\devenv.exe 右键->兼容性疑难解答->疑难解答程序->勾选改程序需要附加权限->测试后下一步->保存设置。 以后甭管双 阅读全文
posted @ 2018-12-08 09:53 做而不求 阅读(1858) 评论(0) 推荐(0) 编辑
摘要: ... 阅读全文
posted @ 2018-12-08 09:23 做而不求 阅读(330) 评论(0) 推荐(0) 编辑
摘要: 以前项目解决方案中,用http协议的asmx Web service作服务器数据访问入口,在SoapHeader中写入用户名和加盐密码进行身份认证。 http asmx服务是明文传输,传输过程中数据很容易被截取、篡改。在内网使用、用户量小、安全问题不严重的情况下运行几年,没有出过大的问题。 但随着项 阅读全文
posted @ 2018-12-06 11:57 做而不求 阅读(330) 评论(0) 推荐(0) 编辑
摘要: 1,引用Log4Net.dll 。当前为2.0.8.0版,可添加Nuget包。我的办法是从下载的包中直接引用相应.net版本的dll以减小项目体积 2,在App.config中增加<section>节和<log4net>节。注意一个配置文件最多只能有一个configSections节,如果有必须是第 阅读全文
posted @ 2018-12-06 11:17 做而不求 阅读(148) 评论(0) 推荐(0) 编辑
摘要: 1,Dupex(双工) MEP(消息交换模式),服务端回调(Callback)客户端操作 2,客户端调用服务时,附加上一个回调对象(InstanceContext)。服务端处理服务请求时,通过该回调对象调用客户端操作。 3,WCF系统设计常用四层结构:Contracts(契约),Services(服 阅读全文
posted @ 2018-12-03 01:01 做而不求 阅读(155) 评论(0) 推荐(0) 编辑
摘要: Part I – Common Examples Bind the result of XPath query “/books/book” from the XML in the XmlDataProvider in a parent’s “Resources” elememt with x:Key 阅读全文
posted @ 2018-10-09 18:45 做而不求 阅读(121) 评论(0) 推荐(0) 编辑