网络进入创建文件夹

        /// <summary>         /// 创建 文件夹         /// </summary>         /// <param name="dirName"></param>

    public void MakeDir(string dirName)     {      HttpWebRequest reqHTTP;      FtpWebRequest reqFTP;      try      {       // dirName = name of the directory to create.

      reqFTP = (FtpWebRequest)FtpWebRequest.Create(new Uri(ftpURI + dirName));

      reqFTP.Method = WebRequestMethods.Ftp.MakeDirectory;

      reqFTP.UseBinary = true;

      reqFTP.Credentials = new NetworkCredential(ftpUserID, ftpPassword);

      FtpWebResponse response = (FtpWebResponse)reqFTP.GetResponse();

      Stream ftpStream = response.GetResponseStream();

      ftpStream.Close();

      response.Close();

     }

 

     catch (Exception ex)      {

 

     }     }

posted @ 2019-05-21 11:25  厦门哈韩  阅读(129)  评论(0编辑  收藏  举报