Page 1 of 2

[Solved] Count Downloads?

Posted: Tue Jul 12, 2011 6:27 am
by Dummy1912
Hello Guys,

Don't worry i know how this works :D
but what i don't know how can i show the current download integer
in to the label:

i save the count integers into a text file
now i like to know how to show it into a label:
Downloaded already: here comes the integer

example:
Downloaded : 2

thanks
Dummy1912

Re: Count Downloads?

Posted: Tue Jul 12, 2011 6:39 am
by Zulf
Use the System.IO namespace. You need to read the text file and convert the used pieces into an integer and display that.

Re: Count Downloads?

Posted: Tue Jul 12, 2011 6:41 am
by Dummy1912
Zulf wrote:
Use the System.IO namespace. You need to read the text file and convert the used pieces into an integer and display that.
Hi Zulf,
sorry I'm not using vb for this
i need it in a html itself :D

Re: Count Downloads?

Posted: Tue Jul 12, 2011 7:27 pm
by Bogoh67
hmm im not much into HTML but umm im guessing after a download has finished
add it somewhere in your code sort of like My.settings in vb and by add it i mean have an integer Then + 1 it, but then again im guessing

Re: Count Downloads?

Posted: Tue Jul 12, 2011 8:13 pm
by Agust1337
I think he means like getting the download counts of a website such as:
File: chrome.exe
Downloads: 54

and then his program retrieves the number 54.

Am I right?

Re: Count Downloads?

Posted: Tue Jul 12, 2011 8:21 pm
by Bogoh67
well if the download url is static there may be a way...

Re: Count Downloads?

Posted: Tue Jul 12, 2011 8:42 pm
by Dummy1912
Hey Agust,

yea you are 100% right :D
Bogoh67 wrote:
well if the download url is static there may be a way...
do you know a way? please

Re: Count Downloads?

Posted: Tue Jul 12, 2011 8:47 pm
by Bogoh67
Dummy1912 wrote:
Hey Agust,

yea you are 100% right :D
Bogoh67 wrote:
well if the download url is static there may be a way...
do you know a way? please
so do you have one static download url? or do you have multiple or unlimited?

Re: Count Downloads?

Posted: Tue Jul 12, 2011 9:03 pm
by mandai
You could use a server side PHP script to keep track of the downloads, then you can use a meta tag to redirect to the file:
Code: Select all
<meta http-equiv="refresh" content="2; url=file.zip">
<?php

$count = file_get_contents("counter.txt") or die("could not read counter.txt");
echo $count . " downloads so far";
$count++;
file_put_contents("counter.txt", $count) or die("could not write counter.txt");

?>

Re: Count Downloads?

Posted: Tue Jul 12, 2011 9:33 pm
by Zulf
Dummy1912 wrote:
Zulf wrote:
Use the System.IO namespace. You need to read the text file and convert the used pieces into an integer and display that.
Hi Zulf,
sorry I'm not using vb for this
i need it in a html itself :D
Oh no it's my bad I didn't check what section this was in. Carry on.