//显示所有驱动器,并加入目录树中
treeviewitem ltvi_new
int li_count, i
String ls_DriverType
lb_dir.DirList("",16384)
li_count = lb_dir.totalitems()
IF li_count > 0 then
for i = 1 to li_count
ltvi_New.Label = lb_dir.Text(i)
ltvi_New.Data = i -1
ltvi_New.Children = TRUE
//根据驱动器类型设置图标
ls_DriverType=uf_drivetype(lb_dir.Text(i))
//函数uf_drivetype用来获取驱动器类型,根据类型设置图标
Choose case ls_DriverType
case "REMOVABLE"
ltvi_New.PictureIndex = 5
ltvi_New.SelectedPictureIndex =5
CASE "FIXED"
ltvi_New.PictureIndex = 1
ltvi_New.SelectedPictureIndex =2
CASE "CDROM"
ltvi_New.PictureIndex = 6
ltvi_New.SelectedPictureIndex =6
END CHOOSE
This.InsertItemlast(0, ltvi_New)
next
This.selectitem(1)
End if