问题: 解决方案
1.特性定义 [AttributeUsage(AttributeTargets.Property)] public class VerificationAttribute : Attribute { public bool IsEmpty => true; public VerificationAttribute() { } } 2.定义在属性上 /// <summary> /// 域名 /// </summary> [Verification] public string Field…
见代码 [TypeConverter(typeof(DescribedEnumConverter<FlatTypeEnum>))] public enum FlatTypeEnum { [Description("N")] N, [Description("F")] F } public static class EnumExtend<T> where T : Enum { public static T? GetEnumValueByDescription(string desc) { f…
记录下 WTM框架如何引入自定义图标 最终效果图如下: 下面看详细方案 如此即可在全局使用,在菜单上可以配置,在控件上引用位置也正常。
using Spire.Doc; using Spire.Pdf; using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.…
先nuget搜索安装System.IO.Compression.ZipFile using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; using System.IO.Compression; namespace Build_Exe { public class ZipHelper { /// <sum…
using (FileStream lStream = new FileStream(address, FileMode.Open, FileAccess.Read)) { pic_Image.Image = Image.FromStream(lStream); } 使用上面的方法绑定图片,不会抢占本地加载图片的资源。
自动控制软电话 git:https://gitee.com/zuiyuewentian/automation-micro-sip int pid = 0; private void Form2_Load(object sender, EventArgs e) { Process[] ps = Process.GetProcessesByName("MicroSIP"); if (ps.Length > 0) { foreach (Process p in ps) p.Kill(); } pid = Start…
RestSharp,在nuget中引用进项目来 这里封装了,常用的接口请求方式,Post,Get,还有file上传,header处理,鉴权等方式 using RestSharp; using System; namespace FinanceApi { public class APIHelper { private readonly string baseUrl = "http://192.168.60.108:8081/"; /// <summary> /// http请求接口 /// </s…
using NPOI.HSSF.UserModel; using NPOI.SS.UserModel; using NPOI.XSSF.UserModel; using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using Microsoft.Office.Interop.Excel; namespace UpdateData.Common { public cla…