摘要: 原文网站: https://www.cnblogs.com/hnsongbiao/p/9414422.html 通过 重写 OnActionExecutingAsync,来 拦截action的请求消息,当执行OnActionExecutingAsync完成以后才真正进入请求的action中,acti 阅读全文
posted @ 2021-01-29 18:04 越吃越瘦 阅读(1797) 评论(0) 推荐(0) 编辑
摘要: Workbook book = new Workbook(path); WorksheetCollection myColection = book.Worksheets; int k1 = myColection.Count; string[] name = new string[k1]; for 阅读全文
posted @ 2021-01-29 17:33 越吃越瘦 阅读(215) 评论(0) 推荐(0) 编辑
摘要: static class Program { /// <summary> /// 应用程序的主入口点。 /// </summary> [STAThread] static void Main() { try { //处理未捕获的异常 Application.SetUnhandledException 阅读全文
posted @ 2021-01-29 17:25 越吃越瘦 阅读(405) 评论(0) 推荐(0) 编辑
摘要: 配置文件: <?xml version="1.0" encoding="utf-8"?> <configuration> <configSections> <section name="entityFramework" type="System.Data.Entity.Internal.Config 阅读全文
posted @ 2021-01-29 17:21 越吃越瘦 阅读(51) 评论(0) 推荐(0) 编辑
摘要: 读取全部文件: StreamReader f2 = new StreamReader(Path, Encoding.Default); string s = f2.ReadToEnd(); 一行行读取文件: using (StreamReader sr = new StreamReader(full 阅读全文
posted @ 2021-01-29 15:42 越吃越瘦 阅读(59) 评论(0) 推荐(0) 编辑
摘要: public static string UnZipFile(string TargetFile, string EndFile) { try { using (FileStream fs = File.Create(EndFile)) { //读取压缩文件(zip文件),准备解压缩 ZipInpu 阅读全文
posted @ 2021-01-29 15:40 越吃越瘦 阅读(332) 评论(0) 推荐(0) 编辑
摘要: class Program { static void Main(string[] args) { callMethod(); //Console.WriteLine("接口访问开始"); //string s = testreturn(); //Console.WriteLine(s); //Me 阅读全文
posted @ 2021-01-29 15:04 越吃越瘦 阅读(29) 评论(0) 推荐(0) 编辑
摘要: 到目前为止,断断续续学习了Mongo有几个月了,为避免遗忘,在这记录一下 学习文档:https://docs.mongodb.com/manual/reference/operator/aggregation/lookup/ 官方文档mongodbhttp://mongodb.github.io/m 阅读全文
posted @ 2021-01-29 14:46 越吃越瘦 阅读(11) 评论(0) 推荐(0) 编辑
摘要: winform窗体文件中时常需要选择文件及文件存储位置 选择文件 System.Windows.Forms.OpenFileDialog fd = new OpenFileDialog(); fd.Title = "选择文件";//选择框名称 fd.Filter = "xls files (*.xl 阅读全文
posted @ 2021-01-29 11:46 越吃越瘦 阅读(475) 评论(0) 推荐(0) 编辑
摘要: 在winform多线程中,新创建的线程无法访问UI线程创建的窗口控件,设置构造函数 private void Form1_Load(object sender, EventArgs e) { Control.CheckForIllegalCrossThreadCalls = false; } 或 F 阅读全文
posted @ 2021-01-29 10:53 越吃越瘦 阅读(223) 评论(0) 推荐(0) 编辑
摘要: Type.Items.Clear(); if (Product.Text == "光模块") { Type.Items.Add("100G QSFP28 SR4"); Type.Items.Add("100G QSFP28 SR4(旧)"); Type.Items.Add("56G SR4"); T 阅读全文
posted @ 2021-01-29 10:40 越吃越瘦 阅读(190) 评论(0) 推荐(0) 编辑
摘要: 有时候,数据采集样式各异,其中有些数据生成的json字段层层嵌套,有遇到一个复杂json格式,记录一下 1 { 2 "success": true, 3 "data": [ 4 { 5 "Column": [ 6 { 7 "categories": ["2011", "2012","2013","2 阅读全文
posted @ 2021-01-29 10:28 越吃越瘦 阅读(567) 评论(0) 推荐(0) 编辑