David A
David A

Reputation: 41

Visual Studio Project Types

I'm trying to make a web crawler/scraper in C# to get info from news articles and other text based websites and I've realized that I don't know what project type in visual to use or really what the difference between all of them is.

In the past I made most of my little programs in an empty c++ project.

Any advice would be helpful as I'm very new to C# and can code but the backend of visual still confuses me. I'm using the free visual studio 2015.

Thanks. My project options

Upvotes: 0

Views: 1754

Answers (2)

I think the best type should be Console Application. With this type of project you can launch your application via console, or just executing the file directly.

static void Main(string[] args)
{
    Console.WriteLine("Hi i got nothing for you! Program me to be useful!");
}

Example

Also, you could add options to your crawler easily, e.g. the url :

static void Main(string[] args)
{
    if(args.Length == 1)
    {
        Console.WriteLine("I got this! Going to url \'{0}\'...", args[0]);
        // Doing something
        Console.WriteLine("Gotcha!");
        return;
    }

    Console.WriteLine("Hi i got nothing for you! Give me something to be useful!");
}

Example args

Upvotes: 1

Skyler Austin
Skyler Austin

Reputation: 96

It all depends on how you plan to use the application. If you want to run a .exe from the command line, a Console Application would suffice. If you want a UI, then probably Forms or Web. Or a combination of any of them (for instance, a solution that has core logic in a class library that is shared by both a console application and a website).

Upvotes: 0

Related Questions