CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 1999
    Posts
    22

    Deleting files in VB

    I want to delete some files based on some criteria.

    I am using Dir() command to get the file name. I am checking the file name and deleting that file by Kill statement. But I can not use Dir() statement recursively.

    1. Can U suggest optimized code for writing all the filenames in a directory into array.

    Can I give a file some life time?. I mean to ask is when we create a file, Is there any option to delete it automatically after exactly a month.



    I expect help from all U code gurus,

    Ravi Sangisetti
    Sr.Software Engineer
    Contech India Ltd
    Gandinagar, India

  2. #2
    Join Date
    Apr 1999
    Posts
    19

    Re: Deleting files in VB

    Instead of using the VB Dir command, I suggest that you use the FindFirstFile and FindNextFile windows API calls. These work similiar to the Dir command, but they have the added benefit of being recursive.


  3. #3
    Join Date
    Apr 1999
    Posts
    19

    Re: Deleting files in VB

    Instead of using the VB Dir command, I suggest that you use the FindFirstFile and FindNextFile windows API calls. These work similiar to the Dir command, but they have the added benefit of being recursive.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured