I am trying to download a file from a url, and there are many files, but I don't want to download files that already exists in my drive. So I want to implement to check if file already exists in a folder using C#?...
I am creating a C# console application for some test project, in which I need to get Root folder location (application path) of project, for example, if my project is in "
C:\Project\Program.cs", so i should get "
C:\Project\" drive as root location.
How can I get it using C# console application, in web-application we get it using
Server.MapPath("~/") but I am not sure about console application.