Jump to content

Dvd Den Seçmek


Kral__
 Share

Recommended Posts

[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]

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...