获取程序集路径 父路径 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();

        }
    }
}
原文地址:https://www.cnblogs.com/xh0626/p/5095952.html