Các công tác C# trong loạt bài xích này được chạy trên Visual Studio 2010, cho nên vì thế chương này bản thân xin giải đáp cho các bạn cách tạo nên một Project trong Visual Studio 2010 và cách để Run một chương trình C# vào Visual Studio 2010 như vậy nào.

Bạn đang xem: Cách mở 1 project trong visual studio

Cách chế tạo ra Project trong Visual Studio 2010

Sau khi chúng ta đã thiết lập xong Visual Studio 2010, để chế tạo một Project mới, bạn nhấn vào vào biểu tượng File, tiếp nối chọn New --> Project hoặc nhấn tổng hợp phím Ctrl + Shift + N để sản xuất một project mới.

Bởi vì mình đã tạo một C# Project trước đó rồi cần một vỏ hộp thoại sau đang hiển thị:

*
Nếu chúng ta lần thứ nhất tạo, bạn click chuột vào Installed Templates --> Other Languages --> Visual Studio thì cũng sẽ hiển thị hộp thoại tương tự.

Trong hình trên:

Với những chương trình C# nhỏ dại và cơ bản như trong loạt bài xích này hoặc khi bạn có nhu cầu nhìn thấy hiệu quả trên màn hình hiển thị Console, bạn nên chọn Console Application.Trong phần Name đó là nơi các bạn đặt tên đến Project của mình, như bên dưới đây.

*
Sau đó các bạn nhấn Ok để sản xuất một Project bắt đầu với tên chúng ta đã đặt.

Cách run C# project trong Visual Studio 2010

Để viết code, bạn bấm vào vào Program.cs:

*
Trong hình trên:

Lệnh System.Console.Write
Line("Viet
Jack chuc cac ban hoc tot !!!");
là để in một loại chữ trên screen Console.Nếu chúng ta không thực hiện lệnh Console.Read
Key();
thì lịch trình sẽ chạy và xong luôn (nhanh quá đến nỗi chúng ta không kịp nhìn kết quả). Lệnh này cho phép họ nhìn công dụng một cách ví dụ hơn. Các bạn tự đối chiếu hai ngôi trường hợp sử dụng và không dùng nhé.

Để chạy chương trình C# vào Visual Studio 2010, bạn nhấn phím F5. Chương trình trên của mình sẽ cho hiệu quả sau:

*
Cách chế tạo ra Class mới trong C# Project trong Visual Studio

Để tạo ra một Class mới, bạn nhấn vào phải vào tên project (như ngơi nghỉ trên thì thương hiệu project của bản thân là Viet
Jack
Csharp
), sau đó chọn Add --> New Item hoặc nhấn tổng hợp phím Ctrl + Shift + A, vỏ hộp thoại sau vẫn hiện ra:

*
Trong size ở giữa, các bạn chọn Class, và tại vị trí Name là nơi bạn đặt tên cho class của mình. Sau khi bạn đặt tên xong, thừa nhận Add để sản xuất class mới.

Trong nội dung bài viết này

Applies to:

*
Visual Studio
*
Visual Studio for Mac
*
Visual Studio Code

In this article, we"ll show you how to lớn quickly create a new project in Visual Studio from a template.


Open the "Create a new project" dialog

There are multiple ways to lớn create a new project in Visual Studio. When you first open Visual Studio, the start window appears, và from there, you can select Create a new project.

*

If the Visual Studio development environment is already open, you can create a new project by choosing File > New > Project on the menu bar. You can also select the New Project button on the toolbar, or press Ctrl+Shift+N.

*


Open the "Create a new project" dialog

There are multiple ways to lớn create a new project in Visual Studio. When you first xuất hiện Visual Studio, the start window appears, & from there, you can select Create a new project.

*

If the Visual Studio development environment is already open, you can create a new project by choosing File > New > Project on the menu bar. You can also select the New Project button on the toolbar, or press Ctrl+Shift+N.

*


Select a template type

On the Create a new project dialog, a các mục of your recently selected templates appears on the left. The templates are sorted by most recently used.

If you"re not selecting from the recently used templates, you can filter all available project templates by Language (for example, C# or C++), Platform (for example, Windows or Azure), and Project type (for example, Desktop or Web). You can also enter search text into the tìm kiếm box to further filter the templates, for example, asp.net.


*

The tags that appear under each template correspond to the three dropdown filters (language, platform, và project type).


Tip

If you don"t see the template you"re looking for, you might be missing a workload for Visual Studio. To install additional workloads, for example, Azure Development or Mobile Development with .NET, select the Install more tools và features links to xuất hiện Visual Studio Installer. From there, select the workloads you want khổng lồ install, & then select Modify. After that, additional project templates will be available khổng lồ choose from.

*


*

The tags that appear under each template correspond lớn the three dropdown filters (language, platform, & project type).


Tip

If you don"t see the template you"re looking for, you might be missing a workload for Visual Studio. Lớn install additional workloads, for example, Azure Development or Mobile Development with .NET, select the Install more tools và features links to mở cửa Visual Studio Installer. From there, select the workloads you want lớn install, and then select Modify. After that, additional project templates will be available to choose from.

*


Configure your new project

The Configure your new project dialog has options lớn name your project (and solution), select a disk location, và select a Framework version (if applicable to lớn the template you chose).

*


Note

If you create a new project when you already have a project or solution xuất hiện in Visual Studio, an extra configuration option is available. You can choose to create a new solution or địa chỉ the new project to the solution that"s already open.

*


Configure your new project

The Configure your new project dialog has options to name your project (and solution), select a disk location, & more.

*

The Additional information dialog includes options to lớn select a Framework version, an authentication type, and more.

*

Select Create khổng lồ create the new project.


Add another project to lớn a solution

If you want to địa chỉ cửa hàng another project khổng lồ a solution, right-click the solution node in Solution Explorer and then select Add > New Project.

Xem thêm: Tải bản đồ thành phố lạng sơn ❤️_❤️ khổ lớn phóng to năm 2023


Tip

For an example of a project và solution created from scratch, complete with step-by-step instructions và sample code, see Introduction to projects và solutions.