.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Code Snippets >> Visual Studio >> Post New Resource Bookmark and Share   

 Subscribe to Code Snippets

Delete empty folder in vb.net

Posted By:laptop charles       Posted Date: January 01, 2011    Points: 15    Category: Visual Studio    URL: http://www.dotnetspark.com  

It is used to delete only empty folder.it contain one button and click the button folder will delete.The folder will not found display the message "File not found".
 

Imports System.IO

Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim ch As New DirectoryInfo("C:\charles")
         If ch.Exists() = True Then
            ch.Delete()
            MsgBox("The folder is deleted")
        Else
            MsgBox("The folder is not found")
        End If
    End Sub
End Class

     

Further Readings:

Responses

No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More code samples in C#, ASP.Net, Vb.Net and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend