找回密码
 加入
搜索
查看: 2124|回复: 13

检测驱动器

  [复制链接]
发表于 2009-11-16 14:41:24 | 显示全部楼层 |阅读模式
本帖最后由 chenxianpeng 于 2009-11-16 15:10 编辑

#include <GUIConstants.au3>
$var = DriveGetDrive( "all" )
If NOT @error Then

    For $i = 1 to $var[0]
        RegWrite('HKEY_LOCAL_MACHINE\SOFTWARE\1',$i,'reg_sz',$var[$i])
                $var1 = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\1",$i)
               
    Next
EndIf
#Region ### START Koda GUI section ### Form=


$Form1 = GUICreate("鹏德U盘启动工具", 229, 56, 353, 376)
$Combo1 = GUICtrlCreateCombo('', 8, 24, 100, 25)
GuiCtrlSetData($Combo1,$var1)
$Button1 = GUICtrlCreateButton("安装", 120, 22, 45, 22, 0)
$Button2 = GUICtrlCreateButton("退出", 170, 22, 45, 22, 0)
$Label1 = GUICtrlCreateLabel($var1, 8, 0, 230, 17)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit

        EndSwitch
WEnd



上面的执行 只会显示最后一个驱动器盘符在combo1里面  我想弄下拉菜单 有多少里面就显示多少
不知道怎么下手 哪位大哥帮帮忙

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?加入

×
发表于 2009-11-16 14:45:22 | 显示全部楼层
$aVar = DriveGetDrive( "all" )
$aVar = _arraydelete($aVar, 0)
$sVar=_arraytostring($aVar, "|")
 楼主| 发表于 2009-11-16 14:48:17 | 显示全部楼层
能否给个例子
 楼主| 发表于 2009-11-16 14:53:01 | 显示全部楼层
小弟新手,不知道2楼的兄弟给我的代码应该加在哪里!
发表于 2009-11-16 14:57:53 | 显示全部楼层
$Combo1 = GUICtrlCreateCombo('', 8, 24, 100, 25)
guictrlsetdata(-1, $sVar)
 楼主| 发表于 2009-11-16 15:00:45 | 显示全部楼层
本帖最后由 chenxianpeng 于 2009-11-16 15:03 编辑

不起任何作用啊!
 楼主| 发表于 2009-11-16 15:05:38 | 显示全部楼层
知道原因了
发表于 2009-11-16 15:07:23 | 显示全部楼层
回复 7# chenxianpeng

忘了加默认值了
 楼主| 发表于 2009-11-16 15:12:40 | 显示全部楼层
出来是出来了!但在驱动器前还多了一个驱动器数! 这个如何去掉!
发表于 2009-11-16 15:17:22 | 显示全部楼层
本帖最后由 netegg 于 2009-11-16 15:18 编辑

_arraydelete用了吗?参数忘了是用1还是0了,自己试试吧
发表于 2009-11-17 02:32:00 | 显示全部楼层
#include <GUIConstants.au3>

$Form1 = GUICreate("鹏德U盘启动工具", 229, 56, 353, 376)
$Combo1 = GUICtrlCreateCombo("", 8, 24, 100, 25)
$var = DriveGetDrive("all")
If Not @error Then
        For $i = 1 To $var[0]
                GUICtrlSetData(-1, $var[$i],$var[1])
        Next
EndIf

$Button1 = GUICtrlCreateButton("安装", 120, 22, 45, 22, 0)
$Button2 = GUICtrlCreateButton("退出", 170, 22, 45, 22, 0)
GUISetState(@SW_SHOW)


While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit

        EndSwitch
WEnd
发表于 2010-6-1 14:45:12 | 显示全部楼层
好顶一下,呵呵
发表于 2010-6-4 15:03:52 | 显示全部楼层
受教了.....................
发表于 2011-1-8 20:25:08 | 显示全部楼层
学习了。刚好看到这个。
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-10-2 18:21 , Processed in 0.089594 second(s), 21 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表