You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
766 B

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 = @"\";
}
}