Get current directory for running application in CSharp

Description

The following code shows how to get current directory for running application.

Example


/*  www.j  a v a 2s .  c om*/
using System;
using System.Text;
using System.IO;

public static class Common
{
        public static void Main(String[] argv)
        {
            Console.WriteLine(AppDomain.CurrentDomain.BaseDirectory);
        }
}

The code above generates the following result.





















Home »
  C# Tutorial »
    IO »




File Attribute
File Security
Directory Attribute
Directory Recursive
Binary File
Text Field
Buffered IO
Create Copy Delete Move
CSV
Drive
File System Watcher
Isolated Storage
MemoryStream
Serialize
Zip