上一页 1 2 3 4 5 6 7 ··· 13 下一页
摘要: AutoMapper 基本:var config=new MapperConfiguration(cfg=>{ cfg.CreateMap<Foo,FooTo> });var mapper=config.CreateMapper();var result=mapper.Map<FooTo>(foo) 阅读全文
posted @ 2021-09-11 16:52 灰主流 阅读(96) 评论(0) 推荐(0) 编辑
摘要: roslynSyntaxTree 句法树 lexical词汇的 每一个tree包含-1.SyntaxNodes--每一个有parent和child属性,有DescendantNodes方法来获取子节点2.Syntax tokens -最小片段,无子节点,包含keywords, identifiers 阅读全文
posted @ 2021-09-11 14:30 灰主流 阅读(109) 评论(0) 推荐(0) 编辑
摘要: 通常使用log4net,都是用xml配置,然后代码调用ilog来记录日志。但这就有一个限制,日志名必须在xml里设定好,如果想动态创建日志文件名是不行的。 原始方式如下: 配置xml: <?xml version="1.0" encoding="utf-8" ?> <log4net> <append 阅读全文
posted @ 2021-09-11 13:09 灰主流 阅读(1344) 评论(0) 推荐(0) 编辑
摘要: 定义一个按钮样式 <Window x:Class="WpfApp2可切换按钮.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft 阅读全文
posted @ 2021-09-11 12:01 灰主流 阅读(189) 评论(0) 推荐(0) 编辑
摘要: using System; using System.Collections.Generic; using System.Linq; using System.Runtime.InteropServices; using System.Security; using System.Text; usi 阅读全文
posted @ 2021-03-17 10:34 灰主流 阅读(282) 评论(0) 推荐(0) 编辑
摘要: 正则表达式验证double类型的数字: public class ValidateRegexs { /// <summary> /// 文本验证,[匹配数字],正则表达式 /// 涵盖:整数、小数、正负数,最大9位 /// </summary> public static string Textbo 阅读全文
posted @ 2021-03-15 13:46 灰主流 阅读(452) 评论(0) 推荐(0) 编辑
摘要: static void Convert(string resourcesFilePath) { Process p = new Process(); p.StartInfo.FileName = "cmd.exe "; p.StartInfo.UseShellExecute = false; p.S 阅读全文
posted @ 2021-03-15 10:05 灰主流 阅读(590) 评论(0) 推荐(0) 编辑
摘要: C#中,有时候想把一些【类库】放到另一个文件夹里, 而【类库】又引用其他【静态类库】, 主程序也引用【静态类库】,这时候经常使用Assembly.LoadFrom()方法来加载【类库】,但是有时候会发现【静态类库】被实例化了多次 文件夹结构如下图 测试代码: Main.exe里的代码 Main.cs 阅读全文
posted @ 2021-01-29 17:39 灰主流 阅读(489) 评论(0) 推荐(0) 编辑
摘要: 输入gpedit.msc,确定。 在本地计算机策略-计算机配置-windos设置-安全设置-本地策略-用户权限分配。右侧找到拒绝从网络访问这台计算机。 单击Guest用户或组,再单击删除。再应用,确定。 参考:https://jingyan.baidu.com/article/afd8f4dea9d 阅读全文
posted @ 2021-01-11 15:25 灰主流 阅读(851) 评论(0) 推荐(0) 编辑
摘要: 定义delegateCommand: public class DelegateCommand<T> : ICommand { private readonly Predicate<T> _canExecute; private readonly Action<T> _execute; public 阅读全文
posted @ 2021-01-11 15:21 灰主流 阅读(774) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 ··· 13 下一页