随笔分类 -  c#

摘要:using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace 接口和抽象类 { class Program { 阅读全文
posted @ 2020-10-23 15:07 荼离伤花 阅读(11) 评论(0) 推荐(0)
摘要:1 using System; 2 using System.Collections.Generic; 3 using System.Diagnostics.Tracing; 4 using System.Linq; 5 using System.Text; 6 using System.Threa 阅读全文
posted @ 2020-10-22 13:21 荼离伤花 阅读(10) 评论(0) 推荐(0)
摘要:一,模板方法 using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; namespace JSONTest { class Progra 阅读全文
posted @ 2020-10-21 16:17 荼离伤花 阅读(10) 评论(0) 推荐(0)
摘要:背景: 在我们退出软件时常常需要记录当前的一个状态,而不是在打开软件是加载默认值,所以需要将当前软件的一些属性值或者对象保存下来,保存方式有多种,之前写过一个通过将对象保存成二进制文件的方法,可以参考: https://www.cnblogs.com/sclu/p/13689755.html 现在要 阅读全文
posted @ 2020-10-19 11:38 荼离伤花 阅读(223) 评论(0) 推荐(0)
摘要:保存对象到本地 IFormatter formatter = new BinaryFormatter(); Stream stream = new FileStream(@"ModelsData.bin", FileMode.OpenOrCreate, FileAccess.Write, FileS 阅读全文
posted @ 2020-09-18 10:23 荼离伤花 阅读(1012) 评论(0) 推荐(0)
摘要:1 Form1 form = new Form1(); 2 var page = new TabPage("Form2"); 3 tab1.Controls.Add(page); 4 form.TopLevel = false; 5 form.ControlBox = false; 6 form.B 阅读全文
posted @ 2020-08-20 18:10 荼离伤花 阅读(136) 评论(0) 推荐(0)
摘要:转载自 https://blog.csdn.net/liuqinghui1990/article/details/76943922?utm_medium=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-1.c 阅读全文
posted @ 2020-07-29 14:44 荼离伤花 阅读(966) 评论(0) 推荐(0)
摘要:public void SaveResult(string Content) { WriteCsv("E:/"+sampleName + ".csv", Content); //保存路径 } public void WriteCsv(string FilePath, string WriteCont 阅读全文
posted @ 2020-07-17 15:53 荼离伤花 阅读(283) 评论(0) 推荐(0)
摘要:1 using System; 2 using System.Collections.Generic; 3 using System.IO; 4 using System.Runtime.InteropServices; 5 using System.Text; 6 7 namespace Cons 阅读全文
posted @ 2020-06-16 13:43 荼离伤花 阅读(314) 评论(0) 推荐(0)
摘要:加入ListView,在Columns中添加列。view属性改成Details。 1 private void show_log(string str) 2 { 3 this.BeginInvoke(new MethodInvoker(() => 4 { 5 ListViewItem viewIte 阅读全文
posted @ 2020-06-08 16:11 荼离伤花 阅读(457) 评论(0) 推荐(0)
摘要:client类 1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 5 using System.Threading.Tasks; 6 using System.N 阅读全文
posted @ 2020-06-08 16:01 荼离伤花 阅读(2786) 评论(0) 推荐(1)
摘要:c#中读取文件,可以用来保存日志,写最近退出时的控件参数,读文件可以在打开窗口时加载上次退出时的参数信息。 1 using System; 2 using System.Collections.Generic; 3 using System.IO; 4 using System.Linq; 5 us 阅读全文
posted @ 2020-06-08 15:37 荼离伤花 阅读(2357) 评论(0) 推荐(0)
摘要:public static long GetHardDiskFreeSpace(string str_HardDiskName) //磁盘号 { long freeSpace = new long(); str_HardDiskName = str_HardDiskName + ":\\"; Sys 阅读全文
posted @ 2020-06-08 15:24 荼离伤花 阅读(982) 评论(0) 推荐(0)
摘要:在程序运行时,需要自动删除一些文件,以免硬盘占满。 下列程序自动删除文件/文件夹。 首先从工具箱拖入一个Timer,设置Enabled为True,interval为发生的间隔,事件Tick为要发生的事件。 1 private void timer1_Tick(object sender, Event 阅读全文
posted @ 2020-06-08 15:13 荼离伤花 阅读(3096) 评论(0) 推荐(1)
摘要:1 public static ImageCodecInfo GetEncoderInfo(String mimeType) 2 3 { 4 int j; 5 ImageCodecInfo[] encoders; 6 encoders = ImageCodecInfo.GetImageEncoder 阅读全文
posted @ 2020-06-05 14:14 荼离伤花 阅读(2980) 评论(0) 推荐(0)
摘要://全局声明一个TabPage来保存page //TabPage page = new TabPage(); //在load里初始化。,默认隐藏 // page = tabControl1.TabPages[3]; // tabControl1.TabPages.Remove(page); //通过 阅读全文
posted @ 2020-06-02 23:56 荼离伤花 阅读(990) 评论(0) 推荐(0)
摘要:using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading; using System.Threading.Tasks; namespace 阅读全文
posted @ 2020-05-02 17:54 荼离伤花 阅读(726) 评论(0) 推荐(1)
摘要:服务端 1 using System; 2 using System.Collections.Generic; 3 using System.Net; 4 using System.Net.Sockets; 5 using System.Text; 6 using System.Threading; 阅读全文
posted @ 2020-01-20 14:37 荼离伤花 阅读(9736) 评论(1) 推荐(3)
摘要:Mat mat = OpenCvSharp.Extensions.BitmapConverter.ToMat(image); //bitmap转 matBitmap bitmap = OpenCvSharp.Extensions.BitmapConverter.ToBitmap(mat); // m 阅读全文
posted @ 2020-01-19 11:05 荼离伤花 阅读(5897) 评论(0) 推荐(0)
摘要:using System.Threading; 1.定义线程 Thread ThreadInspect; 2。创建线程对象,并设置线程函数 ThreadInspect = new Thread(() => evaluate()); //开启线程 3.线程函数 private void evaluat 阅读全文
posted @ 2020-01-10 17:29 荼离伤花 阅读(1703) 评论(0) 推荐(0)