Перейти из форума на сайт.

НовостиФайловые архивы
ПоискАктивные темыТоп лист
ПравилаКто в on-line?
Вход Забыли пароль? Первый раз на этом сайте? Регистрация
Компьютерный форум Ru.Board » Компьютеры » Программы » Indigo Rose AutoPlay Media Studio (часть 5)

Модерирует : gyra, Maz

 Версия для печати • ПодписатьсяДобавить в закладки
На первую страницук этому сообщениюк последнему сообщению

Открыть новую тему     Написать ответ в эту тему

KerberX



Full Member
Редактировать | Профиль | Сообщение | Цитировать | Сообщить модератору


Код:
--The ListBox I'm using is named here. So u dont need to type a lot and u know what it is.
LB = "LB_Drive";
 
--Clear Previous Entry
ListBox.DeleteItem(LB, -1);
 
--Disable listbox Updating
ListBox.SetUpdate(LB, false);
 
--Make Suitable objects appear, otherwise remain invisible
ListBox.SetVisible(LB, true);
Label.SetVisible("Label1", true);
Paragraph.SetVisible("Para_DriveProps", true);
Paragraph.SetVisible("Para_Note", true);
Button.SetVisible("Button_Install", true);
Button.SetVisible("Button_ClearListDrive", true);
 
-- Get a list of the available drives.
tDrives = Drive.Enumerate();
 
-- Determine if an error occurred.
error = Application.GetLastError();
 
-- If an error occurred, display the error message.
-- If no error occurred, display the available drives in a dialog.
if (error ~= 0) then
    Dialog.Message("Error", _tblErrorMessages[error], MB_OK, MB_ICONEXCLAMATION, MB_DEFBUTTON1);
else
              --do the following for each drive. Info on the numbering in Help File
              for i,sDrive in pairs(tDrives) do
                      nType=Drive.GetType(sDrive)
                          if nType==0 then
                          nType = "UNKNOWN";
                          elseif nType==1 then
                          nType = "INVALID";
                          elseif nType==2 then
                          nType = "REMOVABLE";
                          elseif nType==3 then
                          nType = "HARD-DRIVE";
                          elseif nType==4 then
                          nType = "NETWORK-DRIVE";
                          elseif nType==5 then
                          nType = "CD-ROM";
                          elseif nType==6 then
                          nType = "RAM DISK";
                          end
                      sText = sDrive;
                      nSpace = Drive.GetFreeSpace(sDrive); -- this gets the unused space in drive
                      nSize = Drive.GetSize(sDrive); -- this gets the full size of the drive
                      if nSpace == -1 then -- the output is -1 if drive is not loaded
                      nSpace = "DRIVE NOT LOADED";
                      sData = "Drive Type : "..nType.."\r\nAvailable Space : "..nSpace;
                      else
                          if nType=="HARD-DRIVE" or nType=="NETWORK-DRIVE" or nType=="RAM DISK" or nType=="REMOVABLE" then
                          sData = "Drive : "..sDrive.."  ["..nType.."]\r\nAvailable Space : "..Math.Round(nSpace/1024,2).." GB / "..Math.Round(nSize/1024,2).." GB".." - [ "..Math.Round(nSpace,2).." Mb / "..Math.Round(nSize,2).." Mb ]";
                          elseif nType=="CD-ROM"  then
                          sData = "Drive : "..sDrive.."  ["..nType.."]\r\nSpace Used : "..Math.Round(nSize/1024,2).." GB".." - [ "..Math.Round(nSize,2).." Mb ]";
                          end
                      end
                     --add the item to the listbox, with the name visible and path as data
                     if nType == "HARD-DRIVE" then
                         ListBox.AddItem(LB, sText, sData);
                     end
              end
 
end
 
--Allow the listbox to display the updated content
ListBox.SetUpdate(LB, true);


Всего записей: 597 | Зарегистр. 08-09-2011 | Отправлено: 00:48 26-11-2015 | Исправлено: KerberX, 01:25 26-11-2015
Открыть новую тему     Написать ответ в эту тему

На первую страницук этому сообщениюк последнему сообщению

Компьютерный форум Ru.Board » Компьютеры » Программы » Indigo Rose AutoPlay Media Studio (часть 5)


Реклама на форуме Ru.Board.

Powered by Ikonboard "v2.1.7b" © 2000 Ikonboard.com
Modified by Ru.B0ard
© Ru.B0ard 2000-2024

BitCoin: 1NGG1chHtUvrtEqjeerQCKDMUi6S6CG4iC

Рейтинг.ru