随笔分类 - C#
摘要:可以使用 FiddlerCore4 版本 4.6.2.0(在nuget网站下载可以拦截http/https请求(https 需要安装证书 可以多级代理(在 FiddlerApplication_BeforeRequest 中设置 oSession["X-OverrideGateway"] = “IP
阅读全文
摘要:实现方式: 1.读取剪切板内容 2.处理string,拼接sql 3.把结果写入剪切板
阅读全文
摘要:界面 2023年5月29日 最新版支持图片粘贴显示(使用RichTextBox,粘贴板,RichTextBox.Rtf 来实现 sql server 创建表 USE [test] GO /****** Object: Table [dbo].[tb_data] Script Date: 2022/4
阅读全文
摘要:控制台程序 using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace CA.动态编译 { using Mi
阅读全文
摘要:效果图 public class MyCheckedListBox : CheckedListBox { //普通字体 static Font Font1 = new Font(new FontFamily("宋体"), 12, FontStyle.Regular); //中间有横线 static
阅读全文
摘要:using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.
阅读全文
摘要:背景:金蝶dll是.net framework, 在.net core 项目不兼容,这里说明控制台的方式 (另一种做法,再弄一个.net framework网站项目负责调用金蝶服务) 主程序 .Net Core private static string CMDRun(string command)
阅读全文
摘要://可以放到timer里执行 private void button2_Click(object sender, EventArgs e) { string mainTitle = System.Configuration.ConfigurationManager.AppSettings["main
阅读全文
摘要:网上搜到很多理论,没有实际的例子,自己尝试写一写 .Net Framework 4.5 VS 2017 WinForm 项目 using System; using System.Collections.Generic; using System.ComponentModel; using Syst
阅读全文
摘要:/// <summary> /// 设置行距 /// </summary> /// <param name="ctl">控件</param> /// <param name="dyLineSpacing">间距,初始值至少大于(font.size+1)*30</param> public stati
阅读全文
摘要://行高至少大于20 public static void SetComboBoxLineHeight(ComboBox list, int itemHeight) { list.DropDownStyle = ComboBoxStyle.DropDownList; list.ItemHeight
阅读全文
摘要:static class MyParallel { //4.0及以上用Task, Task的背后的实现也是使用了线程池线程 //static List<Task> tasks = new List<Task>(); //4.0以下用Thread static List<Thread> tasks =
阅读全文
摘要:using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace CA.TCP { using System.Ne
阅读全文
摘要:示例代码 using System; using System.Collections.Generic; using System.Drawing; using System.Windows.Forms; public static class ControlDrag { static Dictio
阅读全文
摘要: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
阅读全文
摘要://引用IWshRuntimeLibrary COM组件-Windows Script Host Object Model /// <summary> /// 创建快捷方式的类 /// </summary> /// <remarks></remarks> public class ShortCutH
阅读全文