随笔分类 - c#
摘要:using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace 接口和抽象类 { class Program {
阅读全文
摘要: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
阅读全文
摘要:一,模板方法 using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; namespace JSONTest { class Progra
阅读全文
摘要:背景: 在我们退出软件时常常需要记录当前的一个状态,而不是在打开软件是加载默认值,所以需要将当前软件的一些属性值或者对象保存下来,保存方式有多种,之前写过一个通过将对象保存成二进制文件的方法,可以参考: https://www.cnblogs.com/sclu/p/13689755.html 现在要
阅读全文
摘要:保存对象到本地 IFormatter formatter = new BinaryFormatter(); Stream stream = new FileStream(@"ModelsData.bin", FileMode.OpenOrCreate, FileAccess.Write, FileS
阅读全文
摘要: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
阅读全文
摘要:转载自 https://blog.csdn.net/liuqinghui1990/article/details/76943922?utm_medium=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-1.c
阅读全文
摘要:public void SaveResult(string Content) { WriteCsv("E:/"+sampleName + ".csv", Content); //保存路径 } public void WriteCsv(string FilePath, string WriteCont
阅读全文
摘要: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
阅读全文
摘要:加入ListView,在Columns中添加列。view属性改成Details。 1 private void show_log(string str) 2 { 3 this.BeginInvoke(new MethodInvoker(() => 4 { 5 ListViewItem viewIte
阅读全文
摘要: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
阅读全文
摘要:c#中读取文件,可以用来保存日志,写最近退出时的控件参数,读文件可以在打开窗口时加载上次退出时的参数信息。 1 using System; 2 using System.Collections.Generic; 3 using System.IO; 4 using System.Linq; 5 us
阅读全文
摘要:public static long GetHardDiskFreeSpace(string str_HardDiskName) //磁盘号 { long freeSpace = new long(); str_HardDiskName = str_HardDiskName + ":\\"; Sys
阅读全文
摘要:在程序运行时,需要自动删除一些文件,以免硬盘占满。 下列程序自动删除文件/文件夹。 首先从工具箱拖入一个Timer,设置Enabled为True,interval为发生的间隔,事件Tick为要发生的事件。 1 private void timer1_Tick(object sender, Event
阅读全文
摘要:1 public static ImageCodecInfo GetEncoderInfo(String mimeType) 2 3 { 4 int j; 5 ImageCodecInfo[] encoders; 6 encoders = ImageCodecInfo.GetImageEncoder
阅读全文
摘要://全局声明一个TabPage来保存page //TabPage page = new TabPage(); //在load里初始化。,默认隐藏 // page = tabControl1.TabPages[3]; // tabControl1.TabPages.Remove(page); //通过
阅读全文
摘要:using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading; using System.Threading.Tasks; namespace
阅读全文
摘要:服务端 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;
阅读全文
摘要:Mat mat = OpenCvSharp.Extensions.BitmapConverter.ToMat(image); //bitmap转 matBitmap bitmap = OpenCvSharp.Extensions.BitmapConverter.ToBitmap(mat); // m
阅读全文
摘要:using System.Threading; 1.定义线程 Thread ThreadInspect; 2。创建线程对象,并设置线程函数 ThreadInspect = new Thread(() => evaluate()); //开启线程 3.线程函数 private void evaluat
阅读全文