System.Net.FtpClient.FtpExtensions.GetFtpPath C# (CSharp) 메소드

GetFtpPath() 공개 정적인 메소드

Converts the specified path into a valid FTP file system path
public static GetFtpPath ( this path ) : string
path this The file system path
리턴 string
        public static string GetFtpPath(this string path)
        {
            if (String.IsNullOrEmpty(path))
                return "./";

            path = Regex.Replace(path.Replace('\\', '/'), "[/]+", "/").TrimEnd('/');
            if (path.Length == 0)
                path = "/";

            return path;
        }