You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
834 B
C#
29 lines
834 B
C#
using Common.Extensions.AutofacManager;
|
|
using Common.Provider;
|
|
|
|
namespace Common.Extensions
|
|
{
|
|
public static class ServerExtension
|
|
{
|
|
/// <summary>
|
|
/// 返回的路径后面不带/,拼接时需要自己加上/
|
|
/// </summary>
|
|
/// <param name="path"></param>
|
|
/// <returns></returns>
|
|
public static string MapPath(this string path)
|
|
{
|
|
return MapPath(path, false);
|
|
}
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
/// <param name="path"></param>
|
|
/// <param name="rootPath">获取wwwroot路径</param>
|
|
/// <returns></returns>
|
|
public static string MapPath(this string path, bool rootPath)
|
|
{
|
|
return AutofacContainerModule.GetService<IPathProvider>().MapPath(path, rootPath);
|
|
}
|
|
}
|
|
}
|