sequential file naming

Does VB express alow to do a variable file name?
I'm using a function to download a file off a website every five minuets, but I don't see a way for VB to change the file name each time.


Dim webClient1AsNew WebClient
webClient1.DownloadFile("http://www.URLtoDownloadFrom.net", "C:\filename.html")



But I can't get filename.html to start a filename01.html, filename02.html....
Is It capable?

[817 byte] By [Modderman] at [2007-12-16]
# 1


(global)
Dim i as Integer = 0

Dim webClient1 As New WebClient
webClient1.DownloadFile("http://www.URLtoDownloadFrom.net", "C:\filename.html" + i.toString())
i = i + 1


try that
East at 2007-9-9 > top of Msdn Tech,Visual Basic,Visual Basic General...
# 2
Actually, you would need to do


webClient1.DownloadFile("http://www.URLtoDownloadFrom.net", "C:\filename" + i.toString() + ".html")

The way you had it you would get a filename like c:\filename.html1 or html2...

I think thats right anyways.....if not someone correct me.
Jason

AlEdwards at 2007-9-9 > top of Msdn Tech,Visual Basic,Visual Basic General...
# 3
You are correct Jason,

This code would work ok, but if it always saves with the same name, then you'll have files being overwriten when the program restarts, (or iis is turned off).

You may want to include the date/time in the file name.

Dustin_H at 2007-9-9 > top of Msdn Tech,Visual Basic,Visual Basic General...
# 4
Dustin_H wrote:
You are correct Jason,

This code would work ok, but if it always saves with the same name, then you'll have files being overwriten when the program restarts, (or iis is turned off).

You may want to include the date/time in the file name.

Very true.

AlEdwards at 2007-9-9 > top of Msdn Tech,Visual Basic,Visual Basic General...