create account

Introduction to C# and .NET by leoumesh

View this thread on: hive.blogpeakd.comecency.com
· @leoumesh ·
$2.80
Introduction to C# and .NET
<div class="text-justify">

![image.png](https://images.hive.blog/DQmXDE3dSNvgpi4U76dhCo8tRyceizRUQSPRuaUZ1v5zLZd/image.png)
<center>[Image Source](https://blog.devgenius.io/an-introduction-to-c-and-the-net-library-a893246759)</center>

C#, also pronounced as C-sharp, is a widely used programming language developed by Microsoft and runs on .NET framework. It was developed in the year 2002, and its syntax and object-oriented programming approaches and principles are quite similar to C++ and Java. So, if you are familiar with any of these language, then learning C# is straightforward for you. Even in the modern days, many of the top-tiered companies still use C# to build a wide range of applications including desktop applications, web applications, mobile applications (Xamarin), game development (Unity), cloud computing (Microsoft Azure), AI, Augmented reality and Virtual Reality, and so on. Top companies still using C# are: Microsoft, Intel, IBM, Adobe, Dell, Amazon, and so on.

Due to the continuous improvement to the C# by Microsoft and the programming community, C# is getting more and more demanded nowadays than the other programming language. .NET provides libraries and tools to make applications development faster and efficient in C#. The most current version of C# is C#13 that runs with .NET 9 SDK version. .NET SDK (Software Development Kit) is a software building tool for C# programming language.

If you want to learn C#, then one thing I find the easiest one was using Visual Studio Code, developed by Microsoft and is very light-weight. There's a lot of libraries and extensions built by Microsoft that you can install inside the visual studio code. Downloading Visual Studio code is pretty simple and so is the libraries and extensions pack required for learning C# in the visual studio code. If you have downloaded visual studio code, just install these three important extensions: .NET SDK 9, .NET extension pack, and C# Dev kit, all created by Microsoft that you can easily find there in visual studio code.

Now we will create a simple C# program to print a Hello World. For that we will create a new folder, and you can name anyway you like. I will open that folder, then right click and select "Open Visual Studio Code". It will open a visual studio code. Now open a terminal in VS code and run `dotnet new console`. It will create some files for us that you don't need to worry about. 

![image.png](https://files.peakd.com/file/peakd-hive/leoumesh/23tkdYUSDpL7WnWXtDvTbCvgXdboxSab3ynF21bvk9VX7ZzEeoB4ZfKqJz1EZ43n4iso9.png)

As you can see it automatically created a program C# file with some automatic code. If you write `dotnet run` in the terminal you can see the output but we will do it the right way by writing everything. So delete that two line code in `program.cs` file and write the following code:

```
using System;

class Program{
    static void Main()
    {
        Console.WriteLine("Hello, World. Welcome to C# Programming Language");
    }
}

```

<hr>

The output for above code while compiling and running will be as below:

![image.png](https://files.peakd.com/file/peakd-hive/leoumesh/23swe9k7kFs5KvtNpvAUt3iVTkv9A5r4tbNfUkCzSM97T78Jf9t8frZRyPpEntEpFpLVB.png)
Now we will see a breakdown of what each syntax means and what it does in C# programming.

1. `using System`: This means we are using system namespace and its built-in classes and functions. Example: console classes and WriteLine functions in above code.

2. `class Program{}`: C# should contain at least one class for the entry point and **Program** does that.

3. `static void Main()`: Any code that goes inside this one is the main code that will be executed and is the main program. 

4. `Console.WriteLine`: As explained above, it will print the above statement.

The important thing to remember in C# programming language is the use of **semi-colon (;)**. And C# is case-sensitive as well. Hope that covers the general introduction to C# programming language. Stay tune for more!!!

</div>
👍  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , and 203 others
👎  
properties (23)
authorleoumesh
permlinkintroduction-to-c-and-net
categoryhive-196387
json_metadata{"app":"peakd/2025.3.4","format":"markdown","tags":["programming","code","coding","tutorial","stem","tech","education","csharp","program"],"users":[],"image":["https://images.hive.blog/DQmXDE3dSNvgpi4U76dhCo8tRyceizRUQSPRuaUZ1v5zLZd/image.png","https://files.peakd.com/file/peakd-hive/leoumesh/23tkdYUSDpL7WnWXtDvTbCvgXdboxSab3ynF21bvk9VX7ZzEeoB4ZfKqJz1EZ43n4iso9.png","https://files.peakd.com/file/peakd-hive/leoumesh/23swe9k7kFs5KvtNpvAUt3iVTkv9A5r4tbNfUkCzSM97T78Jf9t8frZRyPpEntEpFpLVB.png"]}
created2025-03-19 10:55:39
last_update2025-03-19 10:55:39
depth0
children3
last_payout2025-03-26 10:55:39
cashout_time1969-12-31 23:59:59
total_payout_value1.378 HBD
curator_payout_value1.419 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length4,017
author_reputation212,340,493,251,438
root_title"Introduction to C# and .NET"
beneficiaries
0.
accountstemsocial
weight500
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id141,531,818
net_rshares8,708,024,774,669
author_curate_reward""
vote details (268)
@stemsocial ·
re-leoumesh-introduction-to-c-and-net-20250320t035858876z
<div class='text-justify'> <div class='pull-left'>
 <img src='https://stem.openhive.network/images/stemsocialsupport7.png'> </div>

Thanks for your contribution to the <a href='/trending/hive-196387'>STEMsocial community</a>. Feel free to join us on <a href='https://discord.gg/9c7pKVD'>discord</a> to get to know the rest of us!

Please consider delegating to the @stemsocial account (85% of the curation rewards are returned).

Thanks for including @stemsocial as a beneficiary, which gives you stronger support.&nbsp;<br />&nbsp;<br />
</div>
👍  
properties (23)
authorstemsocial
permlinkre-leoumesh-introduction-to-c-and-net-20250320t035858876z
categoryhive-196387
json_metadata{"app":"STEMsocial"}
created2025-03-20 03:58:57
last_update2025-03-20 03:58:57
depth1
children0
last_payout2025-03-27 03:58:57
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length545
author_reputation22,919,516,021,813
root_title"Introduction to C# and .NET"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id141,548,827
net_rshares11,468,017,259
author_curate_reward""
vote details (1)
@tecnotronics ·
muy bueno el C# super interesante!
properties (22)
authortecnotronics
permlinkstg469
categoryhive-196387
json_metadata{"app":"hiveblog/0.1"}
created2025-03-20 23:34:51
last_update2025-03-20 23:34:51
depth1
children1
last_payout2025-03-27 23:34:51
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length34
author_reputation161,493,501,426,608
root_title"Introduction to C# and .NET"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id141,567,991
net_rshares0
@leoumesh ·
Thank you :)
👍  
properties (23)
authorleoumesh
permlinkstny7e
categoryhive-196387
json_metadata{"app":"hiveblog/0.1"}
created2025-03-25 05:07:09
last_update2025-03-25 05:07:09
depth2
children0
last_payout2025-04-01 05:07:09
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length12
author_reputation212,340,493,251,438
root_title"Introduction to C# and .NET"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id141,662,042
net_rshares0
author_curate_reward""
vote details (1)