?
Solved

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

Posted on 2009-05-07
1
Medium Priority
?
795 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 13

Accepted Solution

by:
iHadi earned 2000 total points
ID: 24330709
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

765 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