Solved

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

Posted on 2009-05-07
1
793 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 500 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

Suggested Solutions

Title # Comments Views Activity
VB.Net - String Manipulation Scenario 2 31
Access Schema 6 45
asp.net figure out error 3 26
SQL Server Serialization error 8 15
Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/A_4334-Minify-and-Concatenate-Your-Scripts-and-Stylesheets.html)…
This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

730 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