获取程序集路径 父路径 c#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Reflection;
using System.IO;
namespace ConsoleApplication9
{
    class Program
    {
        static void Main(string[] args)
        {
            string padh = Assembly.GetExecutingAssembly().Location;
            padh = Path.GetDirectoryName(padh);
            Console.WriteLine(Assembly.GetExecutingAssembly().Location);
            Console.WriteLine(Directory.GetParent(padh));
            Console.ReadKey();

        }
    }
}

 

posted @ 2016-01-03 11:38  刀小爱  阅读(189)  评论(0编辑  收藏  举报