How do I create a web directory in vb.net using ftp

I'm using visual studio 2005 and vb.net and need to create a folder on a remote webiste. I have full credntials for the site.
FUNDEZAsked:
Who is Participating?
 
iHadiConnect With a Mentor Commented:
Hi

try the following:
        Dim destUri As String = "ftp://yourHostNameOrIp.com/DirToCreate"
        Dim username As String
        Dim password As String
 
        Dim ftpReq As FtpWebRequest = CType(WebRequest.Create(destUri), FtpWebRequest)
        ftpReq.Method = WebRequestMethods.Ftp.MakeDirectory
        ftpReq.Credentials = New NetworkCredential(username, password)
 
        ftpReq.Proxy = Nothing
 
        Dim ftpResp As FtpWebResponse = CType(ftpReq.GetResponse(), FtpWebResponse)
        Console.WriteLine("Code:" + ftpResp.StatusCode.ToString())
        Console.WriteLine("Desc:" + ftpResp.StatusDescription.ToString())

Open in new window

0
All Courses

From novice to tech pro — start learning today.