没看明白 创建文件夹,名称为F1#1,但实际创建的是名称为F1的文件?
MakeDirectory(ftpDir+"/"+subDir); public void MakeDirectory(string dir) { FtpWebResponse Response = null; try { Uri uri = new Uri(dir); FtpWebRequest Request = (FtpWebRequest)WebRequest.Create(uri); Request.Method = WebRequestMethods.Ftp.MakeDirectory; Request.Credentials = new NetworkCredential(ftpUser, ftpPassWord); // requestStream = Request.GetRequestStream(); Response = (FtpWebResponse)Request.GetResponse(); } catch (Exception ex) { throw new Exception("新建目录出错,目录:" + dir + "异常信息:" + ex.ToString()); } finally { if (Response != null) Response.Close(); } }
我转了一篇FTP操作类,有时间看看,上面有http://www.cnblogs.com/Events/p/3328546.html