get Application Bin Folder - CSharp System.Reflection

CSharp examples for System.Reflection:Assembly

Description

get Application Bin Folder

Demo Code


using System.Web.Compilation;
using System.Web;
using System.Threading;
using System.Reflection;
using System.Linq;
using System.IO;//from  ww  w.  j  a v  a  2  s.c  o  m
using System.Diagnostics;
using System;

public class Main{
        static string getApplicationBinFolder()
        {
            var codeBase = ApplicationAssembly.CodeBase;
            var uri = new UriBuilder(codeBase);
            var path = Uri.UnescapeDataString(uri.Path);
            return Path.GetDirectoryName(path);
        }
}

Related Tutorials