相关疑难解决方法(0)

如何获取ASP.NET应用程序的根文件夹

我想获取应用程序的根文件夹.我使用了以下代码,但这给了bin文件夹,但我需要的是应用程序的根文件夹.有可能得到这个吗?

// This is the full directory and exe name
String fullAppName = Assembly.GetExecutingAssembly().GetName().CodeBase;

// This strips off the exe name
String fullAppPath = Path.GetDirectoryName(fullAppName);
Run Code Online (Sandbox Code Playgroud)

c# asp.net

3
推荐指数
1
解决办法
4万
查看次数

标签 统计

asp.net ×1

c# ×1