/// <summary> /// 绝对路径格式化 /// </summary> /// <param name="InputStr">输入的字符串</param> /// <returns>格式化后的Path</returns> public static string AbsolutePathFormat(string InputStr) { if (VerifyManager.IsAbsolutePath(InputStr)) { return(PathFormat(InputStr)); } return(string.Empty); }
/// <summary> /// 路径格式化 /// </summary> /// <param name="InputStr">输入的字符串</param> /// <returns>格式化后的Path</returns> public static string PathFormat(string InputStr) { if (VerifyManager.IsAbsolutePath(InputStr) || VerifyManager.IsRelativePath(InputStr)) { ReplaceStringModel rsm = new ReplaceStringModel(@"/", @"\"); InputStr = Replace(InputStr, rsm); return(RemvoePathLastChar(InputStr)); } return(string.Empty); }