{"id":5623,"date":"2023-04-08T19:56:30","date_gmt":"2023-04-08T19:56:30","guid":{"rendered":"http:\/\/188.165.224.159:8085\/docs\/gullu-knowledge-base\/test\/"},"modified":"2023-04-10T19:26:41","modified_gmt":"2023-04-10T19:26:41","slug":"test-5623","status":"publish","type":"docs","link":"https:\/\/moshax.com\/docs\/net-knowledge-base\/test-5623\/","title":{"rendered":"Your first project"},"content":{"rendered":"\n

\u0645\u0642\u062f\u0645\u0629 \u062d\u0648\u0644 \u0625\u0646\u0634\u0627\u0621 \u0645\u0634\u0631\u0648\u0639 C # \u0627\u0644\u0623\u0648\u0644 \u0628\u0627\u0633\u062a\u062e\u062f\u0627\u0645 .NET<\/h2>\n\n\n\n

\u0645\u0631\u062d\u0628\u064b\u0627 \u0628\u0643\u0645 \u0641\u064a \u0647\u0630\u0627 \u0627\u0644\u062f\u0631\u0633 \u0627\u0644\u062a\u0645\u0647\u064a\u062f\u064a \u062d\u0648\u0644 \u0625\u0646\u0634\u0627\u0621 \u0645\u0634\u0631\u0648\u0639 C # \u0627\u0644\u0623\u0648\u0644 \u0628\u0627\u0633\u062a\u062e\u062f\u0627\u0645 .NET! \u0633\u0648\u0641 \u0646\u062a\u0639\u0631\u0641 \u0639\u0644\u064a \u0625\u0639\u062f\u0627\u062f \u0628\u064a\u0626\u0629 \u0627\u0644\u062a\u0637\u0648\u064a\u0631 \u0627\u0644\u062e\u0627\u0635\u0629 \u0628\u0643 \u060c \u0648\u0625\u0646\u0634\u0627\u0621 \u0645\u0634\u0631\u0648\u0639 C # \u062c\u062f\u064a\u062f \u060c \u0648\u0643\u062a\u0627\u0628\u0629 \u0628\u0639\u0636 \u0627\u0644\u062a\u0639\u0644\u064a\u0645\u0627\u062a \u0627\u0644\u0628\u0631\u0645\u062c\u064a\u0629 \u0627\u0644\u0623\u0633\u0627\u0633\u064a\u0629 . \u0628\u0646\u0647\u0627\u064a\u0629 \u0647\u0630\u0627 \u0627\u0644\u062f\u0631\u0633 \u060c \u0633\u064a\u0643\u0648\u0646 \u0644\u062f\u064a\u0643 \u0623\u0633\u0627\u0633 \u0645\u062a\u064a\u0646 \u0644\u0625\u0646\u0634\u0627\u0621 \u062a\u0637\u0628\u064a\u0642\u0627\u062a C # \u0623\u0643\u062b\u0631 \u062a\u0639\u0642\u064a\u062f\u064b\u0627 \u0628\u0627\u0633\u062a\u062e\u062f\u0627\u0645 .NET framework.<\/p>\n\n\n\n

Prerequisites<\/h2>\n\n\n\n

\u0642\u0628\u0644 \u0623\u0646 \u0646\u0628\u062f\u0623 \u060c \u062a\u0623\u0643\u062f \u0645\u0646 \u062a\u062b\u0628\u064a\u062a \u0645\u0627 \u064a\u0644\u064a \u0639\u0644\u0649 \u0646\u0638\u0627\u0645\u0643:<\/p>\n\n\n\n

    \n
  1. .NET SDK<\/a> – Download the latest version of the .NET SDK for your operating system.<\/li>\n\n\n\n
  2. Visual Studio Code<\/a> – A lightweight, yet powerful source code editor<\/a> with great support for C# and .NET development.<\/li>\n\n\n\n
  3. [C# extension for Visual Studio Code<\/a>](https:\/\/marketplace.visualstudio.com\/items?itemName=ms-dotnettools.csharp<\/a>) – This extension provides rich support for C# development in Visual Studio Code.<\/li>\n<\/ol>\n\n\n\n

    Creating a New C# Project<\/h4>\n\n\n\n

    Once you have all the prerequisites installed, open your terminal (or command prompt on Windows) and follow these steps to create a new C# project:<\/p>\n\n\n\n

      \n
    1. Create a new directory for your project and navigate to it: mkdir MyFirstCSharpProject cd MyFirstCSharpProject<\/code><\/li>\n\n\n\n
    2. Run the dotnet new<\/code> command to create a new console application project<\/a>: dotnet new console<\/code> This command will generate a new C# console application<\/a> with a single file named Program.cs<\/code>.<\/li>\n\n\n\n
    3. Open the project in Visual Studio Code: code .<\/code> This command will open the current directory in Visual Studio Code<\/li>\n<\/ol>\n\n\n\n

      \u0643\u062a\u0627\u0628\u0629 \u0623\u0648\u0644 \u0643\u0648\u062f C # <\/h4>\n\n\n\n

      In Visual Studio<\/a> Code, you should see the Program.cs<\/code> file in the file explorer<\/a>. This file contains the main class and method for our console application.<\/p>\n\n\n\n

        \n
      1. Open Program.cs<\/code> and take a look at the code:<\/li>\n<\/ol>\n\n\n\n
        using System;\n\nnamespace MyFirstCSharpProject\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            Console.WriteLine(\"Hello World!\");\n        }\n    }\n}<\/code><\/pre>\n\n\n\n
        The Main method is the entry point of our console application, and it's where our program starts executing. In this example, it simply writes \"Hello World!\" to the console.\n\nModify the code to greet the user with their name:\n\nusing System;<\/pre>\n\n\n\n
        namespace MyFirstCSharpProject\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            Console.Write(\"Enter your name: \");\n            string name = Console.ReadLine();\n            Console.WriteLine($\"Hello, {name}!\");\n        }\n    }\n}<\/code><\/pre>\n\n\n\n

        \u062a\u0634\u063a\u064a\u0644 \u0627\u0644\u0645\u0634\u0631\u0648\u0639<\/p>\n\n\n\n

        \u0627\u0644\u0622\u0646 \u0628\u0639\u062f \u0623\u0646 \u0643\u062a\u0628\u0646\u0627 \u0628\u0639\u0636 \u0627\u0644\u062a\u0639\u0644\u064a\u0645\u0627\u062a \u0627\u0644\u0628\u0631\u0645\u062c\u064a\u0629 \u060c \u062f\u0639\u0646\u0627 \u0646\u0642\u0648\u0645 \u0628\u062a\u0634\u063a\u064a\u0644 \u0627\u0644\u0645\u0634\u0631\u0648\u0639:<\/p>\n\n\n\n

        \n    In Visual Studio Code, open the terminal (View > Terminal).\n\n    Run the following command to build and execute the program:\n\n    dotnet run\n\n    You should see the \"Enter your name:\" prompt. Enter your name, and the program will greet you with a personalized message.\n<\/pre>\n\n\n\n
        \n\n\n\n

        \u0644\u0642\u062f \u0642\u0645\u062a \u0628\u0646\u0634\u0627\u0621 \u0645\u0634\u0631\u0648\u0639 C# \u0627\u0644\u0623\u0648\u0644 \u0628\u0646\u062c\u0627\u062d! \u0644\u0642\u062f \u0643\u062a\u0628\u062a \u0628\u0639\u0636 \u0627\u0644\u062a\u0639\u0644\u064a\u0645\u0627\u062a \u0627\u0644\u0628\u0631\u0645\u062c\u064a\u0629 \u0627\u0644\u0623\u0633\u0627\u0633\u064a\u0629\u060c \u0648\u0647\u0630\u0627 \u064a\u0639\u0646\u064a \u0623\u0646\u0647 \u064a\u0645\u0643\u0646\u0643 \u0627\u0644\u0622\u0646 \u0645\u0648\u0627\u0635\u0644\u0629 \u0627\u0633\u062a\u0643\u0634\u0627\u0641 \u0645\u0632\u064a\u062f \u0645\u0646 \u0627\u0644\u0645\u064a\u0632\u0627\u062a \u0648\u0627\u0644\u0645\u0643\u062a\u0628\u0627\u062a \u0627\u0644\u0645\u062a\u0627\u062d\u0629 \u0641\u064a \u0625\u0637\u0627\u0631 .NET \u0644\u0625\u0646\u0634\u0627\u0621 \u062a\u0637\u0628\u064a\u0642\u0627\u062a \u0623\u0643\u062b\u0631 \u062a\u0639\u0642\u064a\u062f\u0627\u064b. \u0623\u062a\u0645\u0646\u0649 \u0644\u0643 \u0627\u0644\u062a\u0648\u0641\u064a\u0642 \u0641\u064a \u0631\u062d\u0644\u062a\u0643 \u0627\u0644\u0628\u0631\u0645\u062c\u064a\u0629!<\/strong><\/p>\n\n\n\n

        <\/a><\/p>\n\n\n\n

        .<\/p>\n","protected":false},"excerpt":{"rendered":"

        \u0645\u0642\u062f\u0645\u0629 \u062d\u0648\u0644 \u0625\u0646\u0634\u0627\u0621 \u0645\u0634\u0631\u0648\u0639 C # \u0627\u0644\u0623\u0648\u0644 \u0628\u0627\u0633\u062a\u062e\u062f\u0627\u0645 .NET \u0645\u0631\u062d\u0628\u064b\u0627 \u0628\u0643\u0645 \u0641\u064a \u0647\u0630\u0627 \u0627\u0644\u062f\u0631\u0633 \u0627\u0644\u062a\u0645\u0647\u064a\u062f\u064a \u062d\u0648\u0644 \u0625\u0646\u0634\u0627\u0621 \u0645\u0634\u0631\u0648\u0639 C # […]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":2021,"menu_order":4,"comment_status":"open","ping_status":"closed","template":"","doc_tag":[],"acf":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/moshax.com\/wp-json\/wp\/v2\/docs\/5623"}],"collection":[{"href":"https:\/\/moshax.com\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/moshax.com\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/moshax.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/moshax.com\/wp-json\/wp\/v2\/comments?post=5623"}],"version-history":[{"count":7,"href":"https:\/\/moshax.com\/wp-json\/wp\/v2\/docs\/5623\/revisions"}],"predecessor-version":[{"id":5875,"href":"https:\/\/moshax.com\/wp-json\/wp\/v2\/docs\/5623\/revisions\/5875"}],"up":[{"embeddable":true,"href":"https:\/\/moshax.com\/wp-json\/wp\/v2\/docs\/2021"}],"wp:attachment":[{"href":"https:\/\/moshax.com\/wp-json\/wp\/v2\/media?parent=5623"}],"wp:term":[{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/moshax.com\/wp-json\/wp\/v2\/doc_tag?post=5623"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}