自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(18)
  • 收藏
  • 关注

原创 GDI+及滚动条的处理

using System.Drawing;using System.Windows.Forms;using System.Diagnostics;namespace WindowsFormsApplication1{ public partial class Form1 : Form { public Form1() { ...

2018-04-16 10:11:40 1311

翻译 C# 单例模式

using System;namespace Singleton{ class Program { static void Main(string[] args) { Console.WriteLine(">>>>单例模式:饿汉式"); Singleton1 one = S...

2018-04-09 14:18:18 295

翻译 C# 抽象工厂模式

using System;namespace AbstractFactory{ class Program { static void Main(string[] args) { //抽象工厂模式,主要用来生产具备特定关系的产品 //增加品牌容易,扩展工厂即可;增加品种难,修改涉及太多 ...

2018-04-09 02:10:17 225

翻译 C# 工厂模式

using System;namespace Factory{ class Program { static void Main(string[] args) { //工厂模式,通过不同的工厂来创建对象,避免了臃肿的选择结构 //增加新的鼠标,只需要创建新的厂就行了。扩展而不是修改 ...

2018-04-09 01:48:24 1501

翻译 C# 简单工厂模式

using System;namespace SimpleFactory{ class Program { static void Main(string[] args) { //简单工厂模式,拥有一个直接创建产品的类 //使用者需要知道:工厂,产品类别,产品接口即可使用,对使用者隐藏了创建 ...

2018-04-09 01:28:03 329

原创 c# volatile 易失域

volatile的作用是: 作为指令关键字,确保本条指令不会因编译器的优化而省略,且要求每次直接读值。多线程的程序,共同访问的内存当中,多个线程都可以操纵,从而无法判定何时这个变量会发生变化可以这样简单理解:线程是并行的,但对volatile的访问是顺序排除的,避免出现脏值using System;using System.Threading;namespace demoVolatile{...

2018-04-07 17:56:37 261

原创 BackgroundWorker简明使用

using System;using System.ComponentModel;using System.Threading;using System.Windows.Forms;namespace bcworker{ public partial class Form1 : Form { //后台工作 private Backgrou...

2018-04-07 10:55:14 5298

原创 c# 异步、重入、Async、Await

如果提示 Task不包含GetAwaiter的定义,请将项目的目标框架改到4.5及以上using System;using System.Windows.Forms;using System.Threading.Tasks;using System.Threading;namespace async{ public partial class Form1 : Form ...

2018-04-07 10:05:35 1695

翻译 C# 元组

var unnamed = ("one", "two");var s=unnamed.Item1;var named = (first: "Zhang", second: "san");var s=named.first;编译器在生成已编译的输出时,会将已定义的名称替换为 Item* 等效项。 已编译的 Microsoft 中间语言 (MSIL) 不包括为这些元素赋予的名称。元组具有相同数量相同类...

2018-04-07 07:33:57 864 1

翻译 c# Lambda

分配给委托类型Func<int, int> square = x => x * x; Console.WriteLine(square(25));作为方法参数传递ShowValue(x => x * x);  private static void ShowValue(Func<int,int> op){Console.WriteLine("{0} x {0} ...

2018-04-07 07:25:13 722

翻译 弃元 - C#

C# 7支持弃元变量,系统不为该变量分配存储空间,所以弃元可减少内存分配。 变量名为下划线_,表示该变量为一个弃元。Person p = new Person("John", "Quincy", "Adams", "Boston", "MA");var (fName, _, city, _) = p;Console.WriteLine($"Hello {fName} of {city}!&quo

2018-04-07 07:09:12 1445

转载 在窗口程序中打开控制台

using System;using System.Runtime.InteropServices;using System.Windows.Forms;namespace WindowsFormsApp1{ public partial class Form1 : Form { // 启动控制台 [DllImport("kernel32...

2018-04-06 21:14:03 1903

原创 迭代器示例

using System;using System.Collections.Generic;namespace demoIterators{ class Program { static void Main(string[] args) { sczs(-100); sczs(1); ...

2018-04-06 20:53:17 443

原创 Linq不分组统计、子查询、计算列及索引器的应用

using System;using System.Linq;namespace e2{ class Program { static void Main(string[] args) { Student[] Class1 = { new Student(11,"张三",new floa...

2018-04-04 15:21:22 596

原创 根据生日设置星座

using System;namespace e1{ class Program { static void Main(string[] args) { Player p = new Player(new DateTime(2018, 4, 3)); Console.WriteLine(p.ToSt...

2018-04-04 13:57:30 920

原创 激光打印机常见故障

问题描述 产品原因 解决方法 打印设备初使用时,可能出现水气白雾、卡纸等现象;印品出现底灰、字迹色浅、模糊、页面漂粉、脏污等现象 特殊的气温气候(如:冬季严寒或雨季潮湿)适成打印机和粉盒湿度太低、纸张受潮等 1、将打日机、打印纸置于有空调且抽湿的环境下使用。 2、并将设备开机预热,待室温达到设备使用所需的环境温度,并先打印数页白纸让打印机恢复到正常的工作状态。(注:不会消耗碳粉,大...

2018-04-04 12:07:29 3180

原创 抓不住的按钮:点与矩形运算、窗体重绘

using System;using System.Drawing;using System.Windows.Forms;namespace e23{ public partial class Form1 : Form { private Rectangle btnRect;//警戒区 private const int padding =...

2018-04-01 09:15:18 211

原创 打开文件对话框、右键菜单和图片框模式

using System;using System.Drawing;using System.Windows.Forms;namespace e22{ public partial class Form1 : Form { public Form1() { InitializeComponent(); ...

2018-04-01 08:30:41 469

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除