Hi. Can someone tell me how to name files incrementally.
For example, I’m trying to make an app that downloads once a day a file from the same site. The problem I’m facing is: I want to name the files that are downloaded something like this day1.jpg, day2.jpg, day3.jpg etc. I already did most of the code…I just need to name the files properly…
private void timer1_Tick(object sender, EventArgs e)
{
i = i + 1;
if (i == 3600)
{
WebClient Download = new WebClient();
Download.DownloadFile("http://www.csharpfriends.com/Members/index.aspx", "C:/Users/Rudolf/Pictures/day"a".jpg");
Date_update();
a = a + 1;
i=0;
}
}
[SIZE=2]
[SIZE=2][SIZE=2][COLOR=black]a and i are declared globally, a starts at 1, i at 0, the timer is updated once a minute, that isn’t the site it will download from (I will copy the correct link later), date_update is already done and working great, and all that needs to be done is naming the file correctly.[/COLOR][/SIZE]
[SIZE=2][COLOR=black]So…anyone know to do this?[/COLOR][/SIZE]
[SIZE=2][COLOR=black]Also, if the image is linked to through a php page (I mean, the page is a php page which only contains an image (just the image, there is no text or anything else) which is replaced on a daily basis), can C# download the image, not the php? And if the image is jpg, can C# save it as bmp?[/COLOR][/SIZE]
[SIZE=2][COLOR=black]Thank you in advance. Bye.[/COLOR][/SIZE][/SIZE][/SIZE]