Solved

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

Posted on 2009-05-07
1
782 Views
Last Modified: 2013-11-07
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.
0
Comment
Question by:FUNDEZ
1 Comment
 
LVL 13

Accepted Solution

by:
iHadi earned 500 total points
Comment Utility
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

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Recently while returning home from work my wife (another .NET developer) was murmuring something. On further poking she said that she has been assigned a task where she has to serialize and deserialize objects and she is afraid of serialization. Wha…
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now