找回密码
 加入
搜索
查看: 225|回复: 1

从DirectX获取内容,win10运行出现问题

[复制链接]
发表于 2023-11-8 10:17:59 | 显示全部楼层 |阅读模式
_dxdiag()

Func _dxdiag()
        $File = @TempDir & "\dxdiag.txt"
        Local $a = FileOpen($File, 0), $i = 1
        If FileExists($File) Then 
                   Local $sDelimiter = "DirectX Version:"
           Else
                   Local $sDelimiter = "DirectX Version:"
                   RunWait(@ComSpec & " /c dxdiag.exe /t " & $File & "", "", @SW_HIDE)
           EndIf
        While 1
                Local $hs = FileReadLine($a)
                If @error Then ExitLoop
                If StringRegExp($hs, $sDelimiter) Then
                        ExitLoop
                EndIf
                $i += 1
                $line = StringStripWS(FileReadLine($File, $i),4)
                $location = StringReplace($line, $sDelimiter,"",0,0)
        WEnd
        FileClose($a)
        MsgBox(0, $line, "" & $location)
        Return $location
EndFunc   ;==>_dxdiag

_VRAM()
Func _VRAM()
        Local $File = @TempDir & "\dxdiag.txt"
        If FileExists($File) Then
                Local $sDelimiter = "Dedicated Memory:"
        Else
                Local $sDelimiter = "Dedicated Memory:"
                RunWait(@ComSpec & " /c dxdiag.exe /t " & $File & "", "", @SW_HIDE)
        EndIf
        Local $a = FileOpen($File, 0), $i = 1
        While 1
                Local $hs = FileReadLine($a)
                If @error Then ExitLoop
                If StringRegExp($hs, $sDelimiter) Then
                        ExitLoop
                EndIf
                $i += 1
                $line2 = StringStripWS(FileReadLine($File, $i),4)
                $location2 = StringReplace($line2, $sDelimiter,"",0,0)
        WEnd
        FileClose($a)
        MsgBox(0, $line2, "" & $location2)
        Return $location2
EndFunc   ;==>_VRAM

以上win10运行出错。


请教,win10运行错误,麻烦大佬给优化改正一下。非常感谢。



首次运行也出错。
>"D:\autoit3\SciTE\ACNWrapper\ACNWrapper.exe" /run /ErrorStdOut /in "H:\AU3\DirectX版本显卡内存.au3" /autoit3dir "D:\autoit3" /UserParams    
+>10:17:12 开始执行 ACNWrapper v.1.0.3.1
+> ============================================
+>执行环境:
+>        CPU构架:        X64
+>        系统构架:        X64
+>        系统语言:        0804
+>        键盘布局:        00000804
+>        内存总量:        16317MB
+>        内存剩余:        14482MB
+>        操作系统:        WIN_7/Service Pack 1
+>        AU3版本:        3.3.9.21
+> ============================================
>运行 AU3Check (3.3.9.21)  开始目录:D:\autoit3
+>10:17:12 AU3Check 完成[CODE]:0
>运行:(3.3.9.21):D:\autoit3\autoit3_x64.exe "H:\AU3\DirectX版本显卡内存.au3"    
"H:\AU3\DirectX??????.au3" (23) : ==> Variable used without being declared.:
MsgBox(0, $line, "" & $location)
MsgBox(0, ^ ERROR
->10:17:13 AutoIt3.exe 完成:[CODE]:1
+>10:17:13 ACNWrapper 完成..
>退出代码: 1        运行时间: 1.116 秒





发表于 2023-11-8 11:16:08 | 显示全部楼层
报错不是这句么:MsgBox(0, $line, "" & $location) 变成 MsgBox(0, $line, "" & $location,"")
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-5-5 03:42 , Processed in 0.070934 second(s), 20 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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