speedyrudolf
Programmer
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...
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.
So....anyone know to do this?
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?
Thank you in advance. Bye.
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...
Code:
private void timer1_Tick(object sender, EventArgs e)
{
i = i + 1;
if (i == 3600)
{
WebClient Download = new WebClient();
Download.DownloadFile("[URL unfurl="true"]http://www.csharpfriends.com/Members/index.aspx",[/URL] "C:/Users/Rudolf/Pictures/day"a".jpg");
Date_update();
a = a + 1;
i=0;
}
}
So....anyone know to do this?
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?
Thank you in advance. Bye.