2022-10-26 18:42:11 +02:00
|
|
|
|
namespace SharedProject.Utils;
|
2022-08-25 09:36:23 +02:00
|
|
|
|
|
|
|
|
|
public static class PathHelper
|
|
|
|
|
{
|
2022-09-14 14:14:21 +02:00
|
|
|
|
public static string GetRootPath()
|
2022-08-25 09:36:23 +02:00
|
|
|
|
{
|
|
|
|
|
var path = Environment.ProcessPath;
|
|
|
|
|
if (path is null)
|
|
|
|
|
{
|
|
|
|
|
throw new ApplicationException();
|
|
|
|
|
}
|
|
|
|
|
var parentPath = Directory.GetParent(path);
|
|
|
|
|
if (parentPath is null)
|
|
|
|
|
{
|
|
|
|
|
throw new ApplicationException();
|
|
|
|
|
}
|
2022-09-14 14:14:21 +02:00
|
|
|
|
return Path.Combine(parentPath.ToString(), "wwwroot");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static string GetDataPath()
|
|
|
|
|
{
|
|
|
|
|
return Path.Combine(GetRootPath(), "data");
|
2022-08-25 09:36:23 +02:00
|
|
|
|
}
|
2023-10-16 12:59:55 +02:00
|
|
|
|
|
|
|
|
|
public static string GetDatatablePath()
|
|
|
|
|
{
|
|
|
|
|
return Path.Combine(GetDataPath(), "datatable");
|
|
|
|
|
}
|
2022-08-25 09:36:23 +02:00
|
|
|
|
}
|