|
-
Oct 19th, 2008, 12:30 AM
#1
Thread Starter
Member
[RESOLVED] Get File Size
Hello.
I was thinking to make a program that will turn off my computer X minutes after a download has finished (while I sleep).
The only problem is to make the program know that the download has finished, and I was thinking about turning off few minutes after the file gets to a particular size. I alredy tried programs that can perform this but they didnt work well. Getting the size of the file (not the exact size of course) will solve the problem.
I'll give you an example for calling a function that returns the file size to label:
Code:
Label1.Caption = GetFileSize("C:\Downloads\DownloadedFile.exe")
Then we will see this on label caption (example):
1,257,895,908 bytes
or 1.2GB, or 1200mb I dont mind.
Any ideas for a function or some code? Thanks.
-
Oct 19th, 2008, 12:38 AM
#2
Fanatic Member
Re: Get File Size
Use
Code:
Label1.Caption = FileLen("C:\Downloads\DownloadedFile.exe")
-
Oct 19th, 2008, 10:14 AM
#3
Thread Starter
Member
Re: Get File Size
Thank you. I knew there were something simple like this but didnt know exactly. Resolved.
-
Oct 20th, 2008, 03:59 AM
#4
Re: [RESOLVED] Get File Size
Depends on the implementation details of the download which you didn't mention... there are implementations wherein the file size is already set initially and the bits are simply overwritten, e.g. bittorrent.
-
Oct 22nd, 2008, 11:11 AM
#5
Thread Starter
Member
Re: [RESOLVED] Get File Size
leinad31: Yes, you are right. But its not a big problem and i'll keep an eye on that.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|