using System;
|
|
using System.IO;
|
|
|
|
namespace Utils.Path
|
|
{
|
|
public class PathUtil
|
|
{
|
|
public static string GetApplicationPath()
|
|
{
|
|
return Environment.CurrentDirectory;
|
|
}
|
|
|
|
public static string GetApplicationPath(string applicationName)
|
|
{
|
|
return GetApplicationPath() + PathSplitter + applicationName;
|
|
}
|
|
|
|
public static string GetFileNameFrom(string pathAndName)
|
|
{
|
|
var lastSplitIndex = pathAndName.LastIndexOf(PathSplitter);
|
|
if (lastSplitIndex < 0)
|
|
return pathAndName;
|
|
return pathAndName.Substring(lastSplitIndex + 1);
|
|
}
|
|
|
|
public static bool IsApplicationFileExist(string fileName_NoPath)
|
|
{
|
|
var fileName = GetApplicationPath(fileName_NoPath);
|
|
return File.Exists(fileName);
|
|
}
|
|
|
|
public static string PathSplitter = @"\";
|
|
}
|
|
}
|