enache vladd
enache vladd

Reputation: 87

C# New Project change default lines project.cs

i`m new to Programming and new to c# & visual studio.

i started to resolve some exercises and save the projects to a specified folder. but every time i want to make another exercise i open a new project and name it exNumber. The vs opens the project.cs with default main().

How can i change the lines of default project.cs to be like this:

    using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ex2
{
    class Program
    {
        static void Main(string[] args)
        {
          Console.WriteLine("Write a C# Sharp program to that takes three numbers(x,y,z) as input and print the output of (x+y)·z and x·y + y·z.");  // To do 
            Console.WriteLine("=================================================================================================");
            Console.WriteLine("RESULT:");
            Console.WriteLine("=================================================================================================");
        }
    }
}

Upvotes: 1

Views: 45

Answers (1)

Blam
Blam

Reputation: 2965

You need to create a Project Template

  1. Create project and set up all the code you want to be in your template.
  2. File -> Export Template -> Project Template -> Follow Dialogs -> Finish
  3. When you need to create a new project select your new template instead of what you're usually choosing such as "Console Application".

Upvotes: 1

Related Questions