随笔分类 - c#
摘要:C# 支持多线程并行执行程序 1.一个程序由一个单线程开始,该单线程由CLR和操作系统创建而成,并具有多线程创建额外线程的功能. 2.创建线程的方法 2.1 通过Thread类来创建线程. ThreadStart委托创建线程 ThreadStart ts=new ThreadStart(Run);//创建指定线程从哪里(哪个方法)开始的委托 Thread th=new Thread(t...
        阅读全文
            
摘要:C#创建目录 var strpatj = HttpRuntime.AppDomainAppPath; if (!Directory.Exists(strpatj+"\\temp")) Directory.CreateDirectory(strpatj + "\\temp"); C#在目录下创建文件 StreamReader sr = new StreamReader(filestrem, Sys...
        阅读全文
            
摘要:using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; /// /// 用于取得一个文本文件的编码方式(Encoding)。 /// publ...
        阅读全文
            
摘要:#region 发送post请求 public static string Post(string str) { string result = ""; HttpWebRequest req = (HttpWebRequest)WebRequest.Create("http://localhost:8563/...
        阅读全文
            
摘要:不知道 画笔 的像素是多少, 设置的是 画线的长度为1; 画笔的宽度 为1
        阅读全文
            
摘要://指定数据前移 ssid private void button3_Click(object sender, EventArgs e) { StringBuilder sb = new StringBuilder(); string str = "686B666B686B666B706B5D9BA
        阅读全文
            
摘要:ctr+shift+p 输入 configure language 进 en更改为zh-cn , 重启vscode即可 , 如果还不行,就安装插件
        阅读全文
            
摘要:配置文件内容为 <?xml version="1.0" encoding="utf-8" ?> <configuration> </configuration> 在配置节点中添加connectionStrings节点 <?xml version="1.0" encoding="utf-8" ?> <
        阅读全文
            
摘要:如果你想在窗体上进行绘画。通常会使用以下方法. 方法1,利用控件或窗体的paint事件中的painEventArgs private void form1_Paint(object sender, PaintEventArgs e) { Graphics g = e.Graphics;//创建画板, } 方法2直接重载控件或窗体的OnPaint方法 protected override void...
        阅读全文
            
摘要:StringBuilder sb = new StringBuilder(); ServiceController[] services = ServiceController.GetServices(); //需要添加引用程序程序集Serviceprocess foreach (ServiceController sController i...
        阅读全文
            
摘要:using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ABCDEFG { public class 依赖注入 { public void test() ...
        阅读全文
            
摘要:public List test(List EntityList) where T : class { return EntityList; }
        阅读全文
            
摘要:private void button1_Click(object sender, EventArgs e) { //需要的数据是 销售订单, 客户名称,项目名称 List<DateTime> dateTimes = new List<DateTime>(); for (int i = 0; i <
        阅读全文
            
摘要:string type = Request["type"]; //值为null; //?type= 值为""; //?type=12 值为"12" string type = Request["type"]; if (type!="A" && type!="B") { return HttpNotF...
        阅读全文
            
摘要:string str = "2019-01"; //name: "2019-01月" str = str.Substring(str.Length - 2, 2); //把第一个0替换为空 var t = Convert.ToInt32(str).ToString();
        阅读全文
            
 
                    
                     
                    
                 
                    
                
 
 
         浙公网安备 33010602011771号
浙公网安备 33010602011771号