[Web]Get Start ASP.NET Core Quickly

Steps to create a new ASP.NET Core SampleInstall dotnet coreDownload and install needed tool and pac [More]

[C#] What is the Task, async and await and why we need it

C# TaskTask class is an asynchronous task wrapper. Thread.Sleep(1000) can stop a thread running for [More]

[DotNet] Class or Struct

To be frank, with powerful server and cpu and SSD discs, I don’t use struct much. however, it is still necessary to understand the difference between them. I think the most difference point is that Class is reference type and struct is value type. class is called by reference, which means changes ... [More]

[DotNet]How to name namespaces in c#

Namespaces are used to organize types into a logical and easy to explore hierarchy and avoid confliction for different types. General rule for naming namespace is <Company>.(<Product>|<Technology>)[.<Feature>][.<Subnamespace>] for example: Microsoft.Visual... [More]

[.NET]Send email with smtp

Code here:         static void SendMail3() {             MailMessage message = new MailMessage("from@microsoft.com", "to@microsoft.com", "subject", "test body");             message.To.Add("new@microsoft.com");  ... [More]

[DotNet]Sql Server connection string format

I found myself always forget the connection string format. this is a memo for it. 1. User Id and password style Data Source=myServerAddress;Initial Catalog=myDataBase;User Id=myUsername;Password=myPassword; Initial Catalog can also be replaced by database 2. User Id and password with Trusted_Con... [More]

[.NET]Word Frequency Calculation

As the title indicates, the following code can calcuate words appearance frequence in a text file. to use this code, 1. run it and input a file name, 2. Press Enter, few seconds later, a result file will be created which contains the word frequence information. class Program {   ... [More]

[.NET]Read RSS by C#

I searched around the net for a C# rss reader, but samples are either too complicated or errors prone. DataSet.ReadXml() gets a bug...So, finnaly I realized that write one of my own rss reader would be a quick and better than use one from the internet. And I think this one is the BEST:)No more words... [More]

[DotNet] Dip into Lambda Expression in C#

"lambda expressions are just delegates (or type-safe "function pointers"). They only look as they are because some assumptions are taken (like a lambda expression are functions and therefore always returns a value) and the types can be automatically fetched by the compiler. The nice side effect is t... [More]

[DotNet].NET and C# fundamentals

1. Why and when to use Inheritance.     a. As a class user, we can create a new class inherited from parent's class. When we use an IDE such as Visual Studio, IDE will auto complete some code for us. - Relationship    b. As a class user, we can reuse other's already de... [More]