摘要: 位于 System.Threading.Tasks.TaskContinuationOptions Thread是基于操作系统级别的线程,而ThreadPool和Task不会创建自己的操作系统线程,二者是由任务调度器(TaskScheduler)执行,默认的调度程序仅仅在ThreadPool上运行。 阅读全文
posted @ 2022-04-12 22:45 Bridgebug 阅读(492) 评论(0) 推荐(0) 编辑
摘要: 假设有一个异步方法taskDo,返回一个Task类型。当我们用任务执行该异步方法,且需等待该方法执行完成时,应该如何创建任务呢??? static void WriteLine(object line) { Console.WriteLine(DateTime.Now.ToString("mm:ss 阅读全文
posted @ 2022-04-12 22:45 Bridgebug 阅读(412) 评论(0) 推荐(0) 编辑
摘要: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System 阅读全文
posted @ 2022-04-12 22:45 Bridgebug 阅读(105) 评论(0) 推荐(0) 编辑
摘要: using System; using System.Collections.Generic; using System.Linq; static class ExtensionMethod { public static IEnumerable<T> Random<T>(this IEnumera 阅读全文
posted @ 2022-04-12 22:45 Bridgebug 阅读(225) 评论(0) 推荐(0) 编辑
摘要: 先看两张图,一个实现自己的效果,一个使用默认的效果: GitHub地址 https://github.com/Bridge2018/WPF-DataGridhttps://github.com/Bridge2018/WPF-DataGrid 不多说,上代码。。。 1.转换器 因为里面有个DateTi 阅读全文
posted @ 2022-04-12 22:45 Bridgebug 阅读(523) 评论(0) 推荐(0) 编辑
摘要: 资源初步认识https://blog.csdn.net/breakbridge/article/details/116271634 一、资源键 大多少时候我们定义一个资源都是将其Key设置为一个字符串,但有时候我们也可以将Key设置为 ComponentResourceKey 对象。 <Applic 阅读全文
posted @ 2022-04-12 22:45 Bridgebug 阅读(371) 评论(0) 推荐(0) 编辑
摘要: 1.下载 SQLite (下载网址: https://www.sqlite.org/download.html) 下载下图三个文件 2.创建数据库 解压 sqlite-tools-win32-x86-3310100.zip 运行 sqlite3.exe 输入 .open [dbName].db (打 阅读全文
posted @ 2020-04-10 14:56 Bridgebug 阅读(606) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2020-04-09 15:22 Bridgebug 阅读(166) 评论(0) 推荐(0) 编辑
摘要: 区分大小写 (在where后面加上 COLLATE Chinese_PRC_CS_AS ) 不区分大小写 加上 COLLATE Chinese_PRC_CI_AS 阅读全文
posted @ 2020-04-02 17:01 Bridgebug 阅读(652) 评论(0) 推荐(0) 编辑
摘要: https://download.csdn.net/download/breakbridge/12029775 阅读全文
posted @ 2020-03-20 17:54 Bridgebug 阅读(220) 评论(0) 推荐(0) 编辑
摘要: https://download.csdn.net/download/breakbridge/12029766 阅读全文
posted @ 2020-03-20 17:53 Bridgebug 阅读(160) 评论(0) 推荐(0) 编辑
摘要: 前言:相较于之前文章,用这种方式优点是可以修改在属性控件上显示的效果,然后重新绑定就可以了 1.效果图 2.使用举例 PropertyGridProperty propertyGridProperty = new PropertyGridProperty(); Property p1 = new P 阅读全文
posted @ 2020-03-18 11:23 Bridgebug 阅读(248) 评论(0) 推荐(0) 编辑
摘要: 1.效果图 2.对象类 public class People { [Category("自定义")] [TypeConverter(typeof(OptionValuesTypeConvertor))] [OptionCollection(1, 54, 6)] public decimal ID 阅读全文
posted @ 2020-03-18 10:43 Bridgebug 阅读(397) 评论(0) 推荐(0) 编辑
摘要: 1.效果图 2.对象和控件 using System.ComponentModel; using System.Drawing; using System.Windows.Forms; namespace AttributeTest { public partial class UserContro 阅读全文
posted @ 2020-03-18 09:52 Bridgebug 阅读(301) 评论(0) 推荐(0) 编辑
摘要: void PrintPanel() { int paperWidth = 178; int paperHeight = 52; var printDocument = new System.Drawing.Printing.PrintDocument(); //指定打印机 //printDocume 阅读全文
posted @ 2020-03-18 09:27 Bridgebug 阅读(263) 评论(0) 推荐(0) 编辑
摘要: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ConsoleApp4 { class Prog 阅读全文
posted @ 2020-03-17 17:52 Bridgebug 阅读(1496) 评论(0) 推荐(0) 编辑
摘要: 语言版本 发布时间 .NET Framework要求 C# 1.0 2002.1 .NET Framework 1.0 C# 1.1\1.2 2003.4 .NET Framework 1.1 C# 2.0 2005.11 .NET Framework 2.0 C# 3.0 2007.11 .NET 阅读全文
posted @ 2020-03-03 10:58 Bridgebug 阅读(195) 评论(0) 推荐(0) 编辑
摘要: 一、获取EF 1.打开NuGet程序包管理器控制台 2.选择默认项目(要导入EF的项目),输入命令:Install-Package EntityFramework 3.若导入成功,在引用中会有以下两个引用 二、添加实体数据模型 1.添加新项,选择ADO.NET 实体数据模型 2.选择Code Fir 阅读全文
posted @ 2020-02-26 10:50 Bridgebug 阅读(18308) 评论(0) 推荐(3) 编辑
摘要: partial class DataGridViewInfo { /// <summary> /// 必需的设计器变量。 /// </summary> private System.ComponentModel.IContainer components = null; /// <summary> 阅读全文
posted @ 2020-01-14 14:42 Bridgebug 阅读(602) 评论(0) 推荐(0) 编辑
摘要: 1.在父控件中居中 /// <summary> /// 控件在父控件中居中 /// </summary> /// <param name="ctr">要设置的控件</param> /// <param name="isLR">左右居中</param> /// <param name="isUD">上 阅读全文
posted @ 2020-01-09 17:58 Bridgebug 阅读(2936) 评论(0) 推荐(0) 编辑
摘要: class CtrEnabled { [System.Runtime.InteropServices.DllImport("user32.dll ")] static extern int SetWindowLong(IntPtr hWnd, int nIndex, int wndproc); [S 阅读全文
posted @ 2020-01-09 17:52 Bridgebug 阅读(425) 评论(0) 推荐(0) 编辑
摘要: 将要实现拖曳的窗体订阅下列两个事件 private void Form1_DragEnter(object sender, DragEventArgs e) { if (e.Data.GetDataPresent(DataFormats.FileDrop)) e.Effect = DragDropE 阅读全文
posted @ 2020-01-09 11:02 Bridgebug 阅读(107) 评论(0) 推荐(0) 编辑
摘要: 1.使用反射需引用 using System.Reflection; 2.创建用于反射的对象 class People { string _name = "1"; //私有字段 public string Name = "2"; //公共字段 public int Age { get; set; } 阅读全文
posted @ 2020-01-09 10:51 Bridgebug 阅读(160) 评论(0) 推荐(0) 编辑
摘要: 1.先将要转换的json或者xml复制到粘贴板 2.在vs中选择下图所示操作,就可以转换为对应的类 注意: 生成的代码可能至少需要 .NET Framework 4.5 或 .NET Core/Standard 2.0。 阅读全文
posted @ 2020-01-08 17:05 Bridgebug 阅读(162) 评论(0) 推荐(0) 编辑
摘要: using System.Xml.Serialization; public class XMLOperate { public static void SerialXml<T>(T t, string path) { using (FileStream finfo = new FileStream 阅读全文
posted @ 2019-12-20 16:59 Bridgebug 阅读(311) 评论(0) 推荐(0) 编辑