C# 中 延时执行方案,如下,如果同一个DelayedProcess 对象连续调用 SetTimeout ,默认取消前一次调用. public class DelayedProcess<Req,Rsp> { public delegate void ExcuteMethod(Result rsp); ...
其他扩展方法详见:https://www.cnblogs.com/zhuanjiao/p/12060937.html IEnumerable的Distinct扩展方法,当集合元素为对象时,可用于元素对象指定字段进行排重集 一、通过指定单个属性进行去重。 举例: var member = member ...
其他扩展方法详见:https://www.cnblogs.com/zhuanjiao/p/12060937.html 主要是是对日期格式的处理 ...
其他扩展方法详见:https://www.cnblogs.com/zhuanjiao/p/12060937.html 随便整一个枚举 举例 :var AppId = ModuleType.ZH.GetDescription() // 得到“中国” ...
项目基本做完了,抽空整理下里面用到的扩展方法,以及复用度很高的代码,省的以后到处去找。 一、C#扩展方法——Distinct去重 二、C#扩展方法——获得枚举Description 三、C#扩展方法——mysql-dapper(MySqlMapperExtensions) 四、C#扩展方法—— 序列 ...
windows 10中Microsoft Edge Beta登录账户提示:以管理员身份运行 Microsoft Edge 时不支持登录。请以非管理员身份重新启动 Microsoft Edge,然后重新尝试登录。 解决方案: 右击edge,属性,兼容性,勾选“windows 7",确定,再双击要开即可 ...
分类:
Windows程序 时间:
2019-12-23 14:57:29
阅读次数:
4331
1. 使用代码方式进行组件注册【依赖服务类】 using System; using System.Collections.Generic; using System.Linq; using System.Text; using CastleDemo.Lib; using Castle.Windso ...
private void button1_Click(object sender, RibbonControlEventArgs e) { Document doc = Globals.ThisAddIn.Application.ActiveDocument; Paragraphs pp= doc.... ...
public static int readPictureDegree(string path) { int rotate = 0; using (var image = System.Drawing.Image.FromFile(path)) { foreach (var prop in imag ...
在使用yaml文件部署Deployment项目时,出现过 error: error validating "xx-Deployment.yaml": error validating data: found invalid field Ports for v1.Container; if you c ...
分类:
Windows程序 时间:
2019-12-23 13:30:25
阅读次数:
1696
一、问题发现 远程链接电脑时间发现远程链接失败 提问在“控制面板” 中打开“程序” 列表中启用“windows 防火墙” 。 按照提示启用防火墙 ,发现启用或关闭页面不可编辑 二、原因是防火墙Windows Defender Firewall 没用启用 打开电脑服务列表(win+r 然后输入serv ...
//这是写的一个类,具体是上传图片的上传和下载 public class FileResult { public int Code { get; set; } public string Msg { get; set; } public string Url { get; set; } } //首先 ...
原文:WPF 获得触笔悬停元素上 触笔可以获得悬停在元素上,这时触笔没有碰到元素,没有碰到屏幕。 如果使用触笔,那么在悬停就需要显示光标位置,这时使用UIElement.StylusInAirMove 事件可以获得触笔悬停在元素上。 需要知道,这个事件是 .net Framework 3.0 之后添... ...
原文:WPF 绑定密码 我们发现我们无法绑定密码框的密码,PasswordBox 的 Password 不能绑定。 我们想做 MVVM ,我们需要绑定密码,不能使用前台 xaml.cs 监听 密码改变得到密码的值,传到 ViewModel 。 本文提供一个简单方法来绑定 WPF 的 Password ...
原文:WPF 拖动时出现 Invalid FORMATETC structure 如果在 WPF 需要支持一个东西可以拖动,那么可以使用 DragDrop ,但是使用这个之后就出现了异常 System.Runtime.InteropServices.COMException was unhandle ...
待整理 字典 定义 Dictionary<string, string> openWith = new Dictionary<string, string>(); 添加元素 openWith.Add("dib", "paint.exe"); 取值 Console.WriteLine("For key ...
1.通过流的方式 1 public void WriteLog(string log) 2 { 3 StreamWriter stream; 4 string path = "D:/WriteLog/"; 5 if (!Directory.Exists(path)) 6 { 7 Directory. ...