C#
DingCT
搬砖人
展开
-
优先精准度匹配排序
/// <summary> /// 优先精准度匹配排序 /// </summary> /// <param name="txt1"></param> /// <param name="txt2"></param> /// <returns></returns> public double Sim(string tx..原创 2021-11-01 09:14:58 · 235 阅读 · 0 评论 -
C# 通过调用.bat文件注册dll
C# 通过调用.bat文件注册dll注册方法:注意:proc.StandardInput.WriteLine("exit");//一定要加这句,不然无法获取docs窗口结果 /// <summary> /// 注册DLL /// </summary> /// <param name="batPath"></param> /// <param name="...原创 2021-05-12 17:54:13 · 396 阅读 · 0 评论 -
WPF 在任务栏中右键关闭窗口,进程还存在的问题
Alt+F4以及任务栏上右键关闭都是触发的window 的closed方法,并不是完全关闭。解决方案:在VS的MainWindow中事件属性添加closed事件,在这个事件中调用关闭程序的代码即可。...转载 2019-07-01 10:48:31 · 1849 阅读 · 0 评论 -
C# 开机自启动和最小化托盘显示
一、 C# 开机自启动C# 开机自启动,这个功能是大多数服务型软件很常用一个功能,但是这个功能确是不太好做,花了两天想对策。不过最终呢,结果还是很满意的。 这个功能要达到的效果是这样的,所有用户开机自启动。 最初在网上找的资料都是修改注册表,基本上都是行如这样的://获取程序执行路径.. string starupPath = Application.Exec...转载 2018-10-26 15:08:09 · 681 阅读 · 0 评论 -
c#多线程时,对控件赋值操作
1、禁用button按钮sB_Move.Invoke(new Action<bool>(p =>{ sB_Move.Enabled = p;}), true);2、给label赋值string lbltext = "";lblProgressBar.Invoke(new Action<String>(p =>{ lb...转载 2018-10-26 10:59:28 · 2505 阅读 · 0 评论 -
c# 在一个程序里唤醒另一个程序(最小化时显示在前面)
方式一:[DllImport("user32.dll ")] private static extern bool SetForegroundWindow(IntPtr hWnd); [DllImport("user32.dll")] private static extern bool ShowWindow(IntPtr hWn...转载 2018-10-25 16:34:48 · 2605 阅读 · 1 评论 -
wpf mvvm 在模板里添加button command 注册事件
Window 的名称为<Window x:Class="wpfYourSystem.Views.Workstation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xa...原创 2018-09-03 15:09:49 · 2685 阅读 · 0 评论