zoukankan      html  css  js  c++  java
  • c#判断ftp文件夹是否存在,不存在则创建文件夹

    private void createdir()
            {
                string uri = "ftp://127.0.0.1/test/;

                if (!Directory.Exists(uri))
                {
                    FtpWebRequest frequest = (FtpWebRequest)FtpWebRequest.Create(new Uri(uri));
                    frequest.Credentials = new NetworkCredential(user, pwd);
                    frequest.Method = WebRequestMethods.Ftp.MakeDirectory;
                    try
                    {
                        FtpWebResponse response = frequest.GetResponse() as FtpWebResponse;
                    }
                    catch { }
                }

            }

  • 相关阅读:
    Asp.Net 获取客户端真实IP方法总结
    C# 中英文符号互转(半角全角互转)
    执行git commit命令提示: “Please tell me who you are”的解决方案
    Tools
    VSC
    DevOps
    VSC
    DevOps
    DevOps
    K8S
  • 原文地址:https://www.cnblogs.com/94cool/p/2164528.html
Copyright © 2011-2022 走看看