Jump to content

Klasör Boyutu


Blue_Edition
 Share

Recommended Posts

[codebox]tAra = File.Find(_SourceFolder .. "\\Programlar", "*.exe", false, false, nil, nil)
if tAra then -- klasor boş değilse
nToplamBoyut = 0;
nDosyaBoyutu = 0;
for i,v in pairs(tAra) do
nDosyaBoyutu = File.GetSize(v)
nToplamBoyut = nToplamBoyut+nDosyaBoyutu
end
nToplamBoyut = String.GetFormattedSize(nToplamBoyut, FMTSIZE_AUTOMATIC, true)
else -- klasör boşsa.
nToplamBoyut = "0 Kb";
end
Label.SetText("dosyaboyutu", "Toplam Boyut: " .. nToplamBoyut)[/codebox]

Link to comment
Share on other sites

kod nerey yaazılacak liste mi butınona mı

list ise on duable click evresine

[code]nSecilen = ListBox.GetSelected("list");
sYol = ListBox.GetItemData("list", nSecilen[1]);
Boyut = File.GetSize(sYol);
sBoyut = String.GetFormattedSize(Boyut, FMTSIZE_AUTOMATIC, true);
Label.SetText("Label4", "Boyut:".." ".. sBoyut);[/code]

Link to comment
Share on other sites

[code]nSec = ListIcon.GetSelected("ListBox1");
nText = ListIcon.GetCellText("ListBox1", nSec, 0);
nYol = _SourceFolder.."\\Programlar\\"..nText..".exe"
Boyut = File.GetSize(nYol);
sBoyut = String.GetFormattedSize(Boyut, FMTSIZE_AUTOMATIC, true);
Label.SetText("Label2", "Boyut:".." ".. sBoyut);[/code]

al bakalım olucakmı

Edited by Kral__
Link to comment
Share on other sites

[quote name='Kral__' date='28 February 2012 - 15:17 ' timestamp='1330435039' post='1162176']
[code]nSec = ListIcon.GetSelected("ListBox1");
nText = ListIcon.GetCellText("ListBox1", nSec, 0);
nYol = _SourceFolder.."\\Programlar\\"..nText..".exe"
Boyut = File.GetSize(nYol);
sBoyut = String.GetFormattedSize(Boyut, FMTSIZE_AUTOMATIC, true);
Label.SetText("Label2", "Boyut:".." ".. sBoyut);[/code]

al bakalım olucakmı
[/quote]

hala tek seçim için yapıyor ya :facepalm:

Link to comment
Share on other sites

  • 1 ay sonra...

arkadaşlar programlar klasörünün içinde sistem,güvenlik vs vs klasörler var bunların toplam boyutunu labele yazdırmak istiyorum ama sadece 1 klasörün boyutunu yazıyor hata nerededir kodları aşagıda verdim.

[code]nFolder = Folder.Find("Programlar", "*", false, nil);
if nFolder then
for x,folder in pairs(nFolder) do
nToplamBoyut = 0;
nDosyaBoyutu = 0;
nDosya = File.Find(folder, "*.exe", false, false, nil, nil);
for a,file in pairs(nDosya) do
nDosyaBoyutu = File.GetSize(file)
nToplamBoyut = nToplamBoyut+nDosyaBoyutu
end
nToplamBoyut = String.GetFormattedSize(nToplamBoyut, FMTSIZE_AUTOMATIC, true)
end
end
Label.SetText("Label4", "Toplam Boyut: " .. nToplamBoyut)[/code]

Link to comment
Share on other sites

[codebox]
nToplamBoyut = 0
nDosya = File.Find(_SourceFolder.."\\Programlar\\, "*.exe", true, false, nil, nil);
for a,file in pairs(nDosya) do
nDosyaBoyutu = File.GetSize(file)
nToplamBoyut = nToplamBoyut+nDosyaBoyutu
end
nToplamBoyut = String.GetFormattedSize(nToplamBoyut, FMTSIZE_AUTOMATIC, true)
Label.SetText("Label4", "Toplam Boyut: " .. nToplamBoyut)
[/codebox]

bunu bi dene.

Edited by Baba_
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...