/// <summary> /// 获取文件名 /// </summary> /// <param name="path"></param> /// <param name="separator"></param> /// <returns></returns> public static string GetFileName(string path, char separator = '/') { path = PathEx.MakePathStandard(path); return(path.Substring(path.LastIndexOf(separator) + 1)); }
/// <summary> /// 获取文件夹名 /// </summary> /// <param name="fileName"></param> /// <returns></returns> public static string GetDirectoryName(string fileName) { fileName = PathEx.MakePathStandard(fileName); return(fileName.Substring(0, fileName.LastIndexOf('/'))); }