Blue_Edition Posted February 25, 2012 Share Posted February 25, 2012 _sourcefolder'a Programlar diye bir klasör oluşturdum bunun içindeki programların toplam Boyutunu Label'e nasıl yazdırabilirim. Quote Link to comment Share on other sites More sharing options...
KintaRo Posted February 25, 2012 Share Posted February 25, 2012 [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] Quote Link to comment Share on other sites More sharing options...
nightmare3519 Posted February 27, 2012 Share Posted February 27, 2012 Peki abicim bunu seçilenlerin boyutunun ne kdar oldğunu nasıl yapabiliriz? Quote Link to comment Share on other sites More sharing options...
Kral__ Posted February 27, 2012 Share Posted February 27, 2012 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] Quote Link to comment Share on other sites More sharing options...
KintaRo Posted February 28, 2012 Share Posted February 28, 2012 @Kral, senin yazdığın sadece o an seçilenin boyutunu gösterir. @nightmare, sende eksik bilgi vermişsin, seçilen ama nerde seçilen? checkbox mı? listbox mı? treelist mi? bunlardan biriyse dosya yolu nerde depolanıyor? Quote Link to comment Share on other sites More sharing options...
Kral__ Posted February 28, 2012 Share Posted February 28, 2012 (edited) hocam daha güzel ve ayrıntılı anlatırsa daha iyi olursa ne yapacağımızı anlayabiliriz bide hocam zaten seçilenlerin boyutunu istiyo Edited February 28, 2012 by Kral__ Quote Link to comment Share on other sites More sharing options...
nightmare3519 Posted February 28, 2012 Share Posted February 28, 2012 ListIcon hocam Quote Link to comment Share on other sites More sharing options...
DivaneTR Posted February 28, 2012 Share Posted February 28, 2012 [b]Proje verirsen daha iyi olur. Dosya yolları lazım bize.[/b] Quote Link to comment Share on other sites More sharing options...
nightmare3519 Posted February 28, 2012 Share Posted February 28, 2012 projeyi daha hayata geçirmedim ama bi iki program atıp yollayım Quote Link to comment Share on other sites More sharing options...
Kral__ Posted February 28, 2012 Share Posted February 28, 2012 (edited) [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 February 28, 2012 by Kral__ Quote Link to comment Share on other sites More sharing options...
KintaRo Posted February 29, 2012 Share Posted February 29, 2012 [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 Quote Link to comment Share on other sites More sharing options...
DivaneTR Posted February 29, 2012 Share Posted February 29, 2012 [b]Ezbere gidiyor, olacağı budur. Dosya adreslerinin nerede depolandığını bile bilmeden kod yazmaya çalışıyor [/b] Quote Link to comment Share on other sites More sharing options...
Kral__ Posted February 29, 2012 Share Posted February 29, 2012 ya bunu isteyen nightmare blue editon istemiyorki zaten night arkdaş seçilenin mi istiyo veya başka türlümü istiyo belli deil ben yapıyım ben seçileni verdim eğer galetisinki gibi istiyorsa örnek var incelesin Quote Link to comment Share on other sites More sharing options...
KintaRo Posted February 29, 2012 Share Posted February 29, 2012 [quote name='nightmare3519' date='27 February 2012 - 17:27 ' timestamp='1330356439' post='1161782'] Peki abicim bunu [color="#FF0000"][b]seçilenlerin[/b][/color] boyutunun ne kdar oldğunu nasıl yapabiliriz? [/quote] Quote Link to comment Share on other sites More sharing options...
Blue_Edition Posted April 20, 2012 Author Share Posted April 20, 2012 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] Quote Link to comment Share on other sites More sharing options...
KintaRo Posted April 21, 2012 Share Posted April 21, 2012 [quote]nDosya = File.Find(folder, "*.exe", false, false, nil, nil);[/quote] yerine [quote]nDosya = File.Find(folder, "*.exe", true, false, nil, nil);[/quote] yazıp deneyin. Quote Link to comment Share on other sites More sharing options...
Blue_Edition Posted April 21, 2012 Author Share Posted April 21, 2012 malesef sorun halen devam ediyor. Quote Link to comment Share on other sites More sharing options...
Blue_Edition Posted April 23, 2012 Author Share Posted April 23, 2012 (edited) arkadaşlar sorun hala çözülmedi sadece 1 klasördeki .exe'lerin toplam boyutunu gösteriyor. Edited April 23, 2012 by Blue_Edition Quote Link to comment Share on other sites More sharing options...
DivaneTR Posted April 29, 2012 Share Posted April 29, 2012 (edited) [b]KintaRo gene mantık hatası yapmış, bu gece sağlam bi kod yazarım.[/b] Edited April 29, 2012 by Baba_ Quote Link to comment Share on other sites More sharing options...
Blue_Edition Posted April 29, 2012 Author Share Posted April 29, 2012 (edited) eywallah bi yerde sorun var ama çözemedim Edited April 29, 2012 by Blue_Edition Quote Link to comment Share on other sites More sharing options...
DivaneTR Posted April 29, 2012 Share Posted April 29, 2012 (edited) [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 April 29, 2012 by Baba_ Quote Link to comment Share on other sites More sharing options...
Blue_Edition Posted April 29, 2012 Author Share Posted April 29, 2012 eywallah Quote Link to comment Share on other sites More sharing options...
DivaneTR Posted April 30, 2012 Share Posted April 30, 2012 [center][b]Küçük bir örnek hazırladım, umarım işinize yarar.[/b] [img]http://i.imgur.com/jAauL.png[/img] [code]http://www.mediafire.com/?qe40a9mj66j79ew[/code][/center] Quote Link to comment Share on other sites More sharing options...
.TekdaL. Posted April 30, 2012 Share Posted April 30, 2012 @Baba_ ie9-10 kullanıyorsunuz galiba mesajınız çift geliyor. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.