Click here to Skip to main content
15,924,193 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Oracle as the database and the front end in VB.Net [modified] Pin
kendo171-Oct-07 23:29
kendo171-Oct-07 23:29 
QuestionInserting pauses in wav files Pin
Benny_Lava1-Oct-07 7:04
Benny_Lava1-Oct-07 7:04 
AnswerRe: Inserting pauses in wav files Pin
MikeMarq1-Oct-07 10:56
MikeMarq1-Oct-07 10:56 
QuestionDeleting old files Pin
IETaxguard1-Oct-07 6:17
IETaxguard1-Oct-07 6:17 
AnswerRe: Deleting old files Pin
Johan Hakkesteegt1-Oct-07 6:42
Johan Hakkesteegt1-Oct-07 6:42 
AnswerRe: Deleting old files Pin
nlarson111-Oct-07 7:03
nlarson111-Oct-07 7:03 
GeneralRe: Deleting old files Pin
IETaxguard1-Oct-07 22:23
IETaxguard1-Oct-07 22:23 
AnswerRe: Deleting old files Pin
Ajay.k_Singh1-Oct-07 7:22
Ajay.k_Singh1-Oct-07 7:22 
You can have a function which will find the oldest file in a given directory and then you may delete it.

Call this function in a loop while System.IO.Directory.GetFiles("Path").Length>n.

Following is such a small function which finds the oldest file at the given path and removes it –

-------------------Start Code--------------

Private Sub RemoveOldFiles()

Dim str() As String

str = System.IO.Directory.GetFiles("Path")

Dim d As Date
Dim oldfile As String


d = Now()

For Each fl As String In System.IO.Directory.GetFiles("Path")


If d > System.IO.File.GetCreationTime(fl) Then

oldfile = fl

d = System.IO.File.GetCreationTime(fl)

End If


Next

System.IO.File.Delete(oldfile)



End Sub

--------------End Sub-------------------

I hope this helpsSmile | :) .

-Dave.

Dave Traister,
ComponentOne LLC.
www.componentone.com

GeneralRe: Deleting old files Pin
IETaxguard1-Oct-07 22:21
IETaxguard1-Oct-07 22:21 
QuestionPerforming input validation on a datagridview column Pin
Mr Oizo1-Oct-07 5:12
Mr Oizo1-Oct-07 5:12 
AnswerRe: Performing input validation on a datagridview column Pin
talasila801-Oct-07 11:15
talasila801-Oct-07 11:15 
GeneralRe: Performing input validation on a datagridview column Pin
talasila801-Oct-07 11:19
talasila801-Oct-07 11:19 
QuestionHow to get the selected index of a ListView item ? Pin
ninkk1-Oct-07 5:03
ninkk1-Oct-07 5:03 
AnswerRe: How to get the selected index of a ListView item ? Pin
Guffa1-Oct-07 6:08
Guffa1-Oct-07 6:08 
QuestionHow to save ?? Pin
get12061-Oct-07 5:02
get12061-Oct-07 5:02 
AnswerRe: How to save ?? Pin
Dave Kreskowiak1-Oct-07 5:22
mveDave Kreskowiak1-Oct-07 5:22 
QuestionXml serilization of controls properties to save and get Pin
get12061-Oct-07 4:50
get12061-Oct-07 4:50 
AnswerRe: Xml serilization of controls properties to save and get Pin
Dave Kreskowiak1-Oct-07 5:17
mveDave Kreskowiak1-Oct-07 5:17 
QuestionI hate Combo Box Pin
fazeepk1-Oct-07 4:13
fazeepk1-Oct-07 4:13 
AnswerRe: I hate Combo Box Pin
Dave Kreskowiak1-Oct-07 5:48
mveDave Kreskowiak1-Oct-07 5:48 
QuestionINSERT INTO Query with apostrophes in filenames? Pin
eyeball_20031-Oct-07 3:52
eyeball_20031-Oct-07 3:52 
AnswerRe: INSERT INTO Query with apostrophes in filenames? Pin
Dave Kreskowiak1-Oct-07 4:13
mveDave Kreskowiak1-Oct-07 4:13 
AnswerRe: INSERT INTO Query with apostrophes in filenames? Pin
eyeball_20031-Oct-07 5:27
eyeball_20031-Oct-07 5:27 
GeneralRe: INSERT INTO Query with apostrophes in filenames? Pin
Dave Kreskowiak1-Oct-07 5:48
mveDave Kreskowiak1-Oct-07 5:48 
AnswerRe: INSERT INTO Query with apostrophes in filenames? Pin
Guffa1-Oct-07 6:32
Guffa1-Oct-07 6:32 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.