ورود

View Full Version : چگونگی بدست آوردن سایز یک فایل فلش



vb.net2008
یک شنبه 02 مرداد 1390, 09:36 صبح
سلام
من فایل های فلشمو با استفاده از TShockwaveFlash نمایش می دم. می خوام سایزشو بدست بیارم باید چیکار کنم؟

Felony
یک شنبه 02 مرداد 1390, 10:24 صبح
سایز فایلشو ؟!

توسط تابع FileSize ، یا استفاده از متد Size از کلاس TFileStream :

with TFileStream.Create('D:\Clip\Aparat\Fantastic Gun.flv', fmOpenRead) do
try
ShowMessage(IntToStr(Size));
finally
Free;
end;


یا استفاده از TSearchRec :

function FileSize(fileName : wideString) : Int64;
var
sr : TSearchRec;
begin
if FindFirst(fileName, faAnyFile, sr ) = 0 then
result := Int64(sr.FindData.nFileSizeHigh) shl Int64(32) + Int64(sr.FindData.nFileSizeLow)
else
result := -1;

FindClose(sr) ;
end;

یا