borderAndreaVB free resources for Visual Basic developersborder

ASP.NET 3.5 Hosting - DiscountASP.NET

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2008 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Next Topic (register dlls) New Topic New Poll Post Reply
AndreaVB Forum : VB General : Save a txt file as a timestamp name
Poster Message
Nicholas
Level: Big Cheese

Registered: 31-08-2002
Posts: 23

icon Save a txt file as a timestamp name

Hi.

Is there any code to save a file with only a timestamp name - or number increments (time.txt or different number.txt) so the previous file does not get overwritten each time? thank u.

29-01-2008 at 05:18 PM
View Profile Send Email to User Show All Posts | Quote Reply
humberto
Level: VB Lord

Registered: 13-01-2005
Posts: 250
icon Re: Save a txt file as a timestamp name

Dim tmpStamp As Variant

tmpStamp = Hour(Time)
tmpStamp = tmpStamp & Minute(Time)
tmpStamp = tmpStamp & Second(Time)
tmpStamp = tmpStamp & ".txt"

29-01-2008 at 06:12 PM
View Profile Send Email to User Show All Posts | Quote Reply
stickleprojects
Level: Moderator


Registered: 09-09-2002
Posts: 983
icon Re: Save a txt file as a timestamp name

Alternatively:

dim filename as string
filename = format(now,"yyyymmddhhnnss") & ".txt"


Note that if you are creating files quickly (ie. under a second), then you should also use the GetTickCount() api function or an internal counter.

Regards
Kieron


____________________________
Build it better, faster, quicker, easier.. then fix it (non-offical MS mission statement)

29-01-2008 at 11:53 PM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : VB General : Save a txt file as a timestamp name
Next Topic (register dlls) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2008 Andrea Tincaniborder