Kral__ Posted October 17, 2011 Share Posted October 17, 2011 Arkadaşlar Dvdyi Taktığımda Dvd deki istediğim uzantıdaki dosyaları listboxa nasıl eklemesi nasıl sağlarım Quote Link to comment Share on other sites More sharing options...
KintaRo Posted October 17, 2011 Share Posted October 17, 2011 [codebox]INIFile.SetValue(_TempFolder .. "\\temp.ini", "kontrol", "cd", "0") tSuruculer = Drive.Enumerate(); for i,v in pairs(tSuruculer) do sTur = Drive.GetType(v) if sTur == DRIVE_CDROM then tAra = File.Find(v, "*.*", true, false, nil, nil) -- burdaki *.* yerine yüklenmesini istediğiniz uzantıyı yazın *.exe gibi INIFile.SetValue(_TempFolder .. "\\temp.ini", "kontrol", "cd", "1") if tAra then ListBox.DeleteItem("ListBox1", -1) for x,y in pairs(tAra) do tAyir = String.SplitPath(y) ListBox.AddItem("ListBox1", tAyir.Filename, "") end else Dialog.Message("Hata", "CD/DVD Sürücüsünde uygun dosya bulunamadı") end break; end end if INIFile.GetValue(_TempFolder .. "\\temp.ini", "kontrol", "cd") == "0" then Dialog.Message("Hata", "Sistemde Takılı CD/DVD sürücü bulunamadı!") end [/codebox] Yukarıdaki kod, Eğer sistemde CD/DVD takılı ise ve içerisinde dosya varsa onları bulup sadece dosya adlarını listeler. CD/DVD sürücü takılı değilse uyarı verir, eğer CD/DVD sürücüsü takılı fakat içinde dosya yoksa başka bir uyarı verir. Eğer sadece dosya adları değil tam dosya yolunu listboxa yüklemek isterseniz 13,14,15,16. satırdaki kodları şunlarla değiştirin: [code]for x,y in pairs(tAra) do ListBox.AddItem("ListBox1", v, "") end[/code] 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.