c#获取程序根目录的可选方法。
一、非Web程序 1、AppDomain.CurrentDomain.Basedirectory 2、Environment.CurrentDirectory 3、HttpRuntime.BinDirectory The path to the current application's/bin directory.
二、Web程序 HttpCurrent.Context.Server.Mappath();
CopyRight © 2010-2021 脚本学堂 Jb200.com , All Rights Reserved.