官术网_书友最值得收藏!

  • .NET Standard 2.0 Cookbook
  • Fiqri Ismail
  • 186字
  • 2021-06-25 22:11:30

How it works...

Let us take a quick look at what we did in the previous recipe. In steps 1 to 4, we created a C#-based console application. The skeleton for a console application already comes with Visual Studio as a template. Giving a proper name to your project and a location is a good habit. These things will help you to track down your project easily for future use. In step 5, we just make sure the default console application template works fine and that there are no surprises waiting for us before doing any actual coding. 

In step 6, we created a static method that takes a string parameter and returns a message with that parameter; this is called String Interpolation. It's a new feature introduced in C# 6.0 and can be used instead of the traditional string.format() method. Step 7 uses that method inside the main method. As in a normal console application, Console.ReadLine() will wait till any key is pressed before exiting. Finally, in step 9, we debug the code to check that everything works fine and as expected. 

主站蜘蛛池模板: 永和县| 平凉市| 江川县| 长垣县| 金川县| 西安市| 黄骅市| 抚顺市| 鹤壁市| 任丘市| 洛阳市| 龙门县| 江安县| 探索| 长岭县| 门源| 罗江县| 丰城市| 蛟河市| 黔东| 于田县| 成都市| 辉县市| 北票市| 肥东县| 沂水县| 盘山县| 横山县| 绍兴市| 兴安县| 海淀区| 福安市| 和政县| 潞城市| 新建县| 章丘市| 从江县| 新绛县| 漳平市| 隆昌县| 延吉市|