Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. What code can i use ?

What code can i use ?

Scheduled Pinned Locked Moved Visual Basic
csharphelpquestion
4 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    A
    wrote on last edited by
    #1

    Hi I am using vb.net2003, Does anyone know any code I can use to delete files in a folder as well as the folder the files are located in? Thanks for any help

    C L M 3 Replies Last reply
    0
    • A A

      Hi I am using vb.net2003, Does anyone know any code I can use to delete files in a folder as well as the folder the files are located in? Thanks for any help

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      You need to manually delete the files first. Directory.GetFiles will give you a list of files to delete.

      Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog

      1 Reply Last reply
      0
      • A A

        Hi I am using vb.net2003, Does anyone know any code I can use to delete files in a folder as well as the folder the files are located in? Thanks for any help

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        To delete files, use: My.Computer.FileSystem.DeleteFile("C:\File_To_Delete.txt") You can also select whether you want the file you are deleting to goto the recycle bin or just to be permanantly deleted. Just use: My.Computer.FileSystem.DeleteFile("C:\File_To_Delete.txt", FileIO.RecycleOption.DeletePermanently)

        1 Reply Last reply
        0
        • A A

          Hi I am using vb.net2003, Does anyone know any code I can use to delete files in a folder as well as the folder the files are located in? Thanks for any help

          M Offline
          M Offline
          manish24
          wrote on last edited by
          #4

          try this imports system.io Dim objDir As New DirectoryInfo("C:\testdel") objDir.Delete(True)

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups