C#基本语法
Bill11YAng
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
字典缓存与函数的互调
Add a new file inside the Hello directory named FibonacciGenerator.cs with the following code: C# = 复制 using System; using System.Collections.Generic; namespace Hello { public class Fibonacci...转载 2019-05-22 16:30:56 · 187 阅读 · 0 评论 -
tuple, valueTuple
tuple : 引用类型 valueTuple: 值类型 超过64k,不建议用结构体 都是用itemN取值 都是1-7 ,之后可以通过 tuple< > 扩展,rest取值 , valueTuple可以直接用itemN取值 valueTuple 可以使用 var(_, X,_) 作为赋值变量,返回值可以不带valueTuple , 类似(string ...原创 2019-08-09 09:34:20 · 409 阅读 · 0 评论 -
ConcurrentDictionary
http://dotnetpattern.com/csharp-concurrentdictionary ConcurrentDictionary is one of five collection classes introduced in .NET 4.0. It exists in System.Collections.Concurrent namespace.ConcurrentDic...转载 2019-07-26 08:41:36 · 553 阅读 · 0 评论 -
Enum.ToString(String)
myColor.ToString("x") ; --------------- 0000000C // 8 位的16进制 , 还有 双字节的16 进制 2 byte or 16 bit // Sample for Enum.ToString(String) using System; class Sample { enum Colors {Red, Gree...翻译 2018-10-10 14:15:02 · 1722 阅读 · 0 评论 -
简单的回调
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading; using System.Threading.Tasks; namespace ConsoleApp1 { class Program { ...原创 2019-04-29 21:28:32 · 177 阅读 · 0 评论 -
At least one object must implement IComparable
转自:http://blog.sina.com.cn/s/blog_486a8cc50102uwxn.html Using delegates class Book { public Book(string id, string name, string author) { ID=id; Name=name; Author=author; } public string ...转载 2019-01-30 20:32:11 · 1974 阅读 · 0 评论 -
继承
这样的继承方式在书上很少遇到,一般也很少会自己想到通过继承的类实现接口 public interface A { void Test(); } public interface B : A { } public class D { public void Test() { ...原创 2019-01-24 17:16:38 · 124 阅读 · 0 评论 -
C# 获取路径的方法
转自https://www.cnblogs.com/Impulse/p/4494077.html 1. System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName -获取模块的完整路径。 2. System.Environment.CurrentDirectory -获取和设置当前目录(该进程从中启动的目录)的...转载 2018-12-21 22:39:37 · 862 阅读 · 0 评论 -
.net core 连接数据库出错的解决方式
No database providers are configured EF7 public void ConfigureServices(IServiceCollection services) { services.Configure<CookiePolicyOptions>(options => ...转载 2018-11-27 11:30:12 · 3985 阅读 · 0 评论 -
Enum.TryParse与 string.Split的应用
enum color { red, blue, green_tea }; static void Main(string[] args) { T = 60; List<int> te = new List<int> { 1, 2, 3 }; int[]...原创 2018-11-01 16:37:02 · 313 阅读 · 0 评论 -
事件 与 委托 Invoke() BeginInvoke()
public delegate void ShowValue(); ShowValue showMethod = testName.DisplayToConsole; showMethod(); // 调用委托方法 using System; class Program { static void Main(string[] args) { ...翻译 2018-09-20 11:59:00 · 1372 阅读 · 0 评论
分享