11 2021 档案
摘要:using System; using System.Collections.Generic; using System.Drawing; using System.IO; using System.Linq; using System.Runtime.Serialization; using Sy
阅读全文
摘要://效率,dapper add list 8000条 40秒,它只要1秒多 public static int SqlBulkCopy<T>(this DbConnection conn, List<T> list) where T : Key { var type = typeof(T); var
阅读全文
摘要://说明//使用场景:对接api,返回json结果,直接转换C# class//如何使用:复制下面js代码在浏览器控制台执行 ` "order_item_id": "28504637", "item_id": "3695819", "item_title": "小茵熊物料包 测试链接勿拍", "cu
阅读全文
摘要:select spIdfrom master..SysProcesseswhere db_Name(dbID) = 'Tb_axxxxx'and spId <> @@SpIdand dbID <> 0 --先查后解除 declare @spid intSet @spid = 149 --锁表进程de
阅读全文
摘要://引用IWshRuntimeLibrary COM组件-Windows Script Host Object Model /// <summary> /// 创建快捷方式的类 /// </summary> /// <remarks></remarks> public class ShortCutH
阅读全文
摘要:class WindowHookerManager { static WindowHooker hooker = new WindowHooker(); public static void SetAllFormIcon() { hooker.OnHookControl += (o, e) => {
阅读全文
摘要:with a as( select * from( select 1 userId , '天津' province union select 1 userId , '北京' union select 1 userId , '上海' union select 2 userId , '北京' union
阅读全文
摘要:ps:提高了编程效率,而且相当好用,自己随时可以添加新的扩展 public static class CommomExtentions { public static bool IsNullOrEmpty(this string str) { return string.IsNullOrEmpty(
阅读全文
摘要:Bitmap b = new Bitmap(Server.MapPath(ppath)); Stream ms = new MemoryStream(); b.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg); 原文: https://www.cnb
阅读全文
摘要:with tt as( select 'A' product, 100 price, '2021第1季度' time union all select 'A' product, 777 price, '2021第1季度' time union all select 'A' product, 111
阅读全文
摘要:this.dataGridView1.BindingContext[this.dataGridView1.DataSource].Position = 5
阅读全文
摘要:Win 键+R calc:计算器 notepad:记事本 mspaint:画图 cmd:控制台 control:控制面板 desk.cpl:打开控制面板中的桌面设置 main.cpl:鼠标设置 inetcpl.cpl:Internet 属性 ncpa.cpl:网络连接 sysdm.cpl:系统属性
阅读全文
摘要:Alt+Tab:窗口切换 Alt+回车:查看所选文件属性 Win 键 + 数字:打开/最小化 任务栏对应程序 Win 键+Shift+Esc: 打开任务管理器 Win 键+ 空格:切换输入法 Win 键+ D: 最小化所有窗口,快速查看桌面,再按一次可以复原 Win 键+方向键:用过都知道,窗口动来
阅读全文
摘要:function addScriptTag(src) { var script = document.createElement('script'); script.setAttribute("type","text/javascript"); script.src = src; document.
阅读全文
摘要:public Image GetHttpImage(string url) { var client = new HttpClient(); var uri = new Uri(Uri.EscapeUriString(url)); byte[] urlContents = client.GetByt
阅读全文
摘要://设置左上角到中心点 g.TranslateTransform(int.Parse(x), int.Parse(y)); //旋转角度 g.RotateTransform(int.Parse("90")); //还原左上角 g.TranslateTransform(-int.Parse(x),-
阅读全文
摘要:static void Main() { //设置应用程序处理异常方式:ThreadException处理 Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException); //处理UI线程异常 Applica
阅读全文
摘要:nuget 安装 DataMatrix.net //示例 DmtxImageEncoder Die = new DmtxImageEncoder(); DataMatrix.net.DmtxImageEncoderOptions option = new DmtxImageEncoderOption
阅读全文
摘要:public static class Ex{ public static T2 Map< T2>(this object t1) where T2 : class { var t1_Pinfos = t1.GetType().GetProperties(); var t2_Pinfos = typ
阅读全文
摘要://调用方式 var frm = new MyForm().Instance(); public static class ExFrm { static Dictionary<string, Form> forms = new Dictionary<string, Form>(); /// <sum
阅读全文
摘要:$("#父窗口元素ID",window.parent.document) window.parent.document.getElementById("父窗口元素ID")
阅读全文
摘要:using NPOI; using NPOI.XSSF.UserModel; using NPOI.SS.UserModel; using NPOI.HSSF.UserModel; NPOI.SS.UserModel.IWorkbook excelbook = null; using (FileSt
阅读全文
摘要:USE 数据库goEXEC dbo.sp_changedbowner N'账号'
阅读全文
摘要:public static double MillimeterToPixel_X(double length) //length是毫米,1厘米=10毫米 { System.Windows.Forms.Panel p = new System.Windows.Forms.Panel(); System
阅读全文
摘要:var configObj = { method //数据的提交方式:get和post url //数据的提交路劲 async //是否支持异步刷新,默认是true data //需要提交的数据 dataType //服务器返回数据的类型,例如xml,String,Json等 success //请
阅读全文
摘要://具体打包过程,参考下面网址 https://www.cnblogs.com/dongh/p/6868638.html VS 扩展和更新-联机 搜索 Microsoft Visual Studio Installer Projects 安装后可以创建打包项目,把文件添加进去,然后生成,得到一个安装
阅读全文
摘要:excel是从网页下载或者其他第三方软件导出的解决方法:使用excel打开,另存为2003版的excel,再导入就好了或者保存为 xlsx
阅读全文
摘要://引用 System.IO.Compression.FileSystem.dll var basePath = AppDomain.CurrentDomain.BaseDirectory; System.IO.Compression.ZipFile.CreateFromDirectory(base
阅读全文
摘要:保存: Configuration config = ConfigurationManager.OpenExeConfiguration(Application.ExecutablePath); if (config.AppSettings.Settings.AllKeys.Contains("ke
阅读全文
摘要:OpenFileDialog控件的基本属性InitialDirectory:对话框的初始目录 Filter: 获取或设置当前文件名筛选器字符串,例如,"文本文件(*.txt)|*.txt|所有文件(*.*)||*.*" FilterIndex 在对话框中选择的文件筛选器的索引,如果选第一项就设为1
阅读全文
摘要:安装BarTender 软件后,会注册一个COM 然后在项目中添加BarTender COM 引用 BarTender模板中的条码右键属性-数据源类型-嵌入的数据-名称(比如设置为 barcode public class MyBarTender { BarTender.Application bt
阅读全文
摘要:public static float GetDpiX() { System.Windows.Forms.Panel p = new System.Windows.Forms.Panel(); System.Drawing.Graphics g = System.Drawing.Graphics.F
阅读全文
摘要:public static string ExportAOrder(ExportData data) { var cellHeard = new Dictionary<string, string> { { "sort","序号"}, { "modeName","型号名称"}, { "modeCod
阅读全文
摘要:1.查看本机ipipconfig 2.查看本机端口使用情况netstat -a 3.查看局域网所有iparp -a 4.查找并关闭进程 C:\WINDOWS\system32>tasklist|findstr 设备设备aa.exe 23000 Console 1 75,120 K C:\WINDOW
阅读全文
摘要:richTextBox1.Select(index, "str1".Length); richTextBox1.SelectionColor = Color.Red;
阅读全文
摘要:CREATE trigger 触发器名 on 表名 for update,delete as set nocount on create table #t(EvebtType varchar(60),Parameters int,EventInfo varchar(2000)) declare @i
阅读全文
摘要://要序列化的类型 [Serializable] public class myclass { public string Name {get;set;} } //序列化 var my = new myclass(); my.Name="1234"; my.SerializeSave("D:\\da
阅读全文
摘要:using (var db = new dbEntities()) { //第一个坑,需要手动open db.Database.Connection.Open(); using (var tran = db.Database.Connection.BeginTransaction()) { //第二
阅读全文
摘要:实现向com1发数据,com2能收到 教程https://www.liangzl.com/get-article-detail-137485.html 串口工具官网www.eltima.com/products/vspdxp
阅读全文
摘要:graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;
阅读全文
摘要:.net framework版本太低,改为.net 4.5以上版本即可。 framework4.5以下版本SecurityProtocolType定义的TLS协议是1.0的,4.5以上是有1.2版本。 或者发送HTTPS请求前加入下行代码解决问题 ServicePointManager.Securi
阅读全文
摘要:推送400错误 cmd 执行 git config --global http.sslVerify false 推送地址,修改http 为 https 就可以正常提交了
阅读全文
摘要:public static string GetTimeStamp() { TimeSpan ts = DateTime.Now - new DateTime(1970, 1, 1, 0, 0, 0, 0); return Convert.ToInt64(ts.TotalSeconds).ToStr
阅读全文
摘要:https://otp.landian.vip/zh-cn/download.html
阅读全文
摘要:public Bitmap ResizeImage(Bitmap bmp, int newW, int newH,int dpi) { var b = new Bitmap(newW, newH); b.SetResolution(dpi,dpi);//设置DPI var g = Graphics.
阅读全文
摘要://image 可以先转换为 bitmap Bitmap bmp = new Bitmap(width, height); bmp.SetResolution(300, 300);
阅读全文
摘要:Graphics.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic; Graphics.SmoothingMode = System.Drawing.Drawing2D.Smoothin
阅读全文
摘要://设置自动换行 dgv.DefaultCellStyle.WrapMode = DataGridViewTriState.True; //设置自动调整高度 dgv.AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.AllCells;
阅读全文
摘要:在窗体load函数中 this.DoubleBuffered = true; //控件,需要反射的方式设置 Type dgvType = this.dgv.GetType(); PropertyInfo p = dgvType.GetProperty("DoubleBuffered", Bindin
阅读全文