Solved

How to tell if file exists before deletion via FTP vb.net

Posted on 2010-09-14
1
945 Views
Last Modified: 2012-05-10
Hi

I use the code below to delete files on my server via FTP. How can I tell if the file exists before I attempt to delete it? I am using vb.net 2008

strFileName = "ftp://" & strFTPAddress & "/" & strFTPImageFolder & "/" & intInvNum & "-1.jpg"
            Dim clsRequest1 As System.Net.FtpWebRequest = DirectCast(System.Net.WebRequest.Create(strFileName), System.Net.FtpWebRequest)
            clsRequest1.Credentials = New System.Net.NetworkCredential(strFTPUserName, strFTPPassword)
            clsRequest1.Method = System.Net.WebRequestMethods.Ftp.DeleteFile
            Dim ftpResp1 As FtpWebResponse = clsRequest1.GetResponse

Thanks

Nick Steele

0
Comment
Question by:nsteele84
1 Comment
 
LVL 7

Accepted Solution

by:
whityum earned 500 total points
ID: 33676879
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

Flash (http://en.wikipedia.org/wiki/Adobe_Flash) has evolved over the years to where it has become a masterful tool for displaying content screen.  It has excellent layout placement, UI precision as well as rendering capabilities. This, along with t…
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…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

777 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