其他分享
首页 > 其他分享> > 网络进入创建文件夹

网络进入创建文件夹

作者:互联网

        /// <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)      {

 

     }     }

标签:ftpStream,FtpWebRequest,创建,网络,文件夹,new,dirName,reqFTP,response
来源: https://www.cnblogs.com/qiu18359243869/p/10898754.html