找回密码
 加入
搜索
查看: 1590|回复: 2

[网络通信] 求助 FindFirstVolumeMountPoint 的写法

[复制链接]
发表于 2020-4-13 07:38:54 | 显示全部楼层 |阅读模式
本帖最后由 itsky2 于 2020-4-13 09:13 编辑

下面是我自己尝试的,无效...
Local $tTag = DllStructCreate("char buffer[256]")
$aRet = DllCall("Kernel32.dll", "int", "FindFirstVolumeMountPoint", "str", $sGUID, "str", $tTag, 'int', DllStructGetSize($tTag))

sGUID这个是设备标识符,用下面的代码可以取到:
$RET = DllCall("Kernel32.dll", "int", "FindFirstVolume", "str", "", "str", 255)
ConsoleWrite($RET[1] & @TAB & DriveGetLabel($RET[1]) & @TAB & DirGetSize($RET[1]) & @CRLF)
$RET[1] = $RET[0]
While 1
        $RET = DllCall("Kernel32.dll", "int", "FindNextVolume", "int", $RET[1], "str", "", "str", 255)
        If Not $RET[0] Then ExitLoop
        ConsoleWrite($RET[2] & @TAB & DriveGetLabel($RET[2]) & @CRLF)
WEnd

 楼主| 发表于 2020-4-13 08:46:25 | 显示全部楼层
https://docs.microsoft.com/en-us ... stvolumemountpointw
补充个文档,顺便如果各位大佬有空的话,再帮忙写个Next的...谢谢
 楼主| 发表于 2020-4-15 08:31:24 | 显示全部楼层
GetVolumePathNamesForVolumeName解决了,谢谢大家!
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-5-19 19:49 , Processed in 0.068909 second(s), 20 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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