找回密码
 加入
搜索
楼主: haijie1223

测试帖子

[复制链接]
 楼主| 发表于 2019-3-10 23:32:00 | 显示全部楼层
html\test\\111

发表于 2019-3-10 23:38:06 | 显示全部楼层
本帖最后由 yuantian 于 2019-3-10 23:41 编辑
$KeyPath = "HKLM\SYSTEM\CurrentControlSet\Enum"
$INDEX = 57
$Computer = "."
$objWMIService = ObjGet("winmgmts:\\.\root\CIMV2")
$colSettings = $objWMIService.ExecQuery("Select * from Win32_DesktopMonitor")
For $objOperatingSystem In $colSettings
        $tmp = $objOperatingSystem.PNPDeviceID
        $EDID = RegRead($KeyPath & $tmp & "\Device Parameters", "EDID")
        If $EDID <> "" Then
                $Width = Int(BinaryMid($EDID, $INDEX, 1)) + BitAND(Int(BinaryMid($EDID, $INDEX + 2, 1)), 240) * 16
                $Height = Int(BinaryMid($EDID, $INDEX + 3, 1)) + BitAND(Int(BinaryMid($EDID, $INDEX + 5, 1)), 240) * 16
                MsgBox(0, "显示器EDID读取", "显示器分辨率:" & $Width & "x" & $Height & @CRLF & _
                                "生产日期" & Int(BinaryMid($EDID, 18, 1)) + 1990 & "年 第" & Int(BinaryMid($EDID, 17, 1)) & "周" & @CRLF & _
                                "EDID版本号:" & Int(BinaryMid($EDID, 19, 1)) & "." & Int(BinaryMid($EDID, 20, 1)) & @CRLF)
        EndIf
Next
 楼主| 发表于 2019-3-11 21:57:41 | 显示全部楼层

$KeyPath = "HKLM\SYSTEM\CurrentControlSet\Enum\"
$INDEX = 57
$Computer = "."
$objWMIService = ObjGet("winmgmts:\\.\root\CIMV2")
$colSettings = $objWMIService.ExecQuery("Select * from Win32_DesktopMonitor")
For $objOperatingSystem In $colSettings
        $tmp = $objOperatingSystem.PNPDeviceID
        $EDID = RegRead($KeyPath & $tmp & "\Device Parameters", "EDID")
        If $EDID <> "" Then
                $Width = Int(BinaryMid($EDID, $INDEX, 1)) + BitAND(Int(BinaryMid($EDID, $INDEX + 2, 1)), 240) * 16
                $Height = Int(BinaryMid($EDID, $INDEX + 3, 1)) + BitAND(Int(BinaryMid($EDID, $INDEX + 5, 1)), 240) * 16
                MsgBox(0, "显示器EDID读取", "显示器分辨率:" & $Width & "x" & $Height & @CRLF & _
                                "生产日期" & Int(BinaryMid($EDID, 18, 1)) + 1990 & "年 第" & Int(BinaryMid($EDID, 17, 1)) & "周" & @CRLF & _
                                "EDID版本号:" & Int(BinaryMid($EDID, 19, 1)) & "." & Int(BinaryMid($EDID, 20, 1)) & @CRLF)
        EndIf
Next







 楼主| 发表于 2019-3-12 22:10:59 | 显示全部楼层
#include <Access.au3>
#include 'MSSQL.au3'
#include <GUIListView.au3>
#include <GuiImageList.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

Global $iIP = '127.0.0.1,1220' ; IP地址
Global $sUserName = 'sa' ; 连接帐号
Global $sPassWord = 'admin' ; 连接密码
Global $sDatabase = 'MYDB' ; 数据库名
Global $sTableName = 'TestTable1' ; 表名称

$sqlCon = _MSSQL_Con($iIP, $sUserName, $sPassWord, $sDatabase)

GUICreate('MSSQL - 数据库操作例子', 800, 600)
$ListView1 = GUICtrlCreateListView('ID|第一列|第二列|第三列|第四列|第五列', 5, 5, 790, 540, -1, _
                BitOR($WS_EX_CLIENTEDGE, $LVS_EX_FULLROWSELECT, $LVS_REPORT))
_GUICtrlListView_SetColumnWidth($ListView1, 0, 130)
_GUICtrlListView_SetColumnWidth($ListView1, 1, 130)
_GUICtrlListView_SetColumnWidth($ListView1, 2, 130)
_GUICtrlListView_SetColumnWidth($ListView1, 3, 130)
_GUICtrlListView_SetColumnWidth($ListView1, 4, 130)
_GUICtrlListView_SetColumnWidth($ListView1, 5, 130)

$hImage = _GUIImageList_Create(1, 25)
_GUICtrlListView_SetImageList($ListView1, $hImage, 1)

$Button1 = GUICtrlCreateButton('创建表', 10, 560, 100, 30, 0)
$Button2 = GUICtrlCreateButton('写入数据', 130, 560, 100, 30, 0)
$Button3 = GUICtrlCreateButton('读取数据', 250, 560, 100, 30, 0)
$Button4 = GUICtrlCreateButton('更新数据', 370, 560, 100, 30, 0)
$Button5 = GUICtrlCreateButton('删除数据', 490, 560, 100, 30, 0)
$Button6 = GUICtrlCreateButton('查找数据', 610, 560, 100, 30, 0)
GUISetState()

While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case -3
                        ; 关闭数据库连接
                        _MSSQL_End($sqlCon)
                        Exit
                Case $Button1
                        ; 在数据库中创建表的同时创建相应的列
                        _MSSQL_CreateTable($sqlCon, $sTableName, False, 'ID char(17),第一列 Text,第二列 Text,第三列 Text,第四列 Text,第五列 Text')

                Case $Button2;写入
                        Local $aValue[6]
                        $aValue[0] = (@YEAR & @MON & @MDAY & @HOUR & @MIN & @SEC & @MSEC)
                        $aValue[1] = '添加数据 - ' & Random(100, 999, 1)
                        $aValue[2] = '添加数据 - ' & Random(100, 999, 1)
                        $aValue[3] = '添加数据 - ' & Random(100, 999, 1)
                        $aValue[4] = '添加数据 - ' & Random(100, 999, 1)
                        $aValue[5] = '添加数据 - ' & Random(100, 999, 1)
                        
                        $sText = _ArrayToString($aValue)
                        GUICtrlCreateListViewItem($sText, $ListView1)
                        _MSSQL_AddRecord($sqlCon, $sTableName, $aValue)
                        
                Case $Button3 ;读取
                        _MYSQL_ReadDataToList($sqlCon, $sTableName)

                        
                Case $Button5 ;删除
                        $iIndex = GUICtrlRead($ListView1)
                        If $iIndex Then
                                $sItemText = GUICtrlRead($iIndex)
                                $iID = StringRegExpReplace($sItemText, '\|.+', '')
                                GUICtrlDelete($iIndex)
                                _MSSQL_DeleteRecord($sqlCon, $sTableName, $iID, 'ID')
                        EndIf
                        
                        
                Case $Button4 ;更新
                        $iIndex = GUICtrlRead($ListView1)
                        If $iIndex Then
                                $sItemText = GUICtrlRead($iIndex)
                                $iID = StringRegExpReplace($sItemText, '\|.+', '')
                                GUICtrlDelete($iIndex)
                                $iNumber = (@YEAR & @MON & @MDAY & @HOUR & @MIN & @SEC & @MSEC)
;~                                 _MSSQL_UpdateRecord($sqlCon, $sTableName, "ID", $sValue, "WHere ID = '" & $iID & "'")
                                
                                Local $aColumn[6] ; 需要更新数据的列名,位置与下面的更新的值对齐,数量必须相同。
                                $aColumn[0] = 'ID'
                                $aColumn[1] = '第一列'
                                $aColumn[2] = '第二列'
                                $aColumn[3] = '第三列'
                                $aColumn[4] = '第四列'
                                $aColumn[5] = '第五列'
                                
                                Local $aNewValue[6] ; 新的数据,位置与上面的列对齐,数量必须相同。
                                $aNewValue[0] = $iNumber
                                $aNewValue[1] = '更新数据 - ' & Random(100, 999, 1)
                                $aNewValue[2] = '更新数据 - ' & Random(100, 999, 1)
                                $aNewValue[3] = '更新数据 - ' & Random(100, 999, 1)
                                $aNewValue[4] = '更新数据 - ' & Random(100, 999, 1)
                                $aNewValue[5] = '更新数据 - ' & Random(100, 999, 1)
                                
;~                                 $aNewValue[1] = Random(100, 9999, 1)
;~                                 $aNewValue[2] = Random(100, 9999, 1)
;~                                 $aNewValue[3] = Random(100, 9999, 1)
;~                                 $aNewValue[4] = Random(100, 9999, 1)
;~                                 $aNewValue[5] = Random(100, 9999, 1)                                
                                
                                _MSSQL_UpdateRecordEx($sqlCon, $sTableName, $aColumn, $aNewValue, $iID)
                                _MYSQL_ReadDataToList($sqlCon, $sTableName)
                        EndIf
                Case $Button6 ;查找
                        $aFindData = _MSSQL_GetRecord($sqlCon, $sTableName, '第五列', 'WHere ID = ' & "'580'")
                        _ArrayDisplay($aFindData)
        EndSwitch
WEnd

Func _MYSQL_ReadDataToList($sqlCon, $sTable)
        Local $sText
        _GUICtrlListView_BeginUpdate($ListView1)
        GUICtrlSendMsg($ListView1, 4105, 0, 0)
        $aRecord = _MSSQL_GetRecord($sqlCon, $sTable)
        For $i = 1 To UBound($aRecord) - 1
                For $z = 0 To 5
                        $sText &= $aRecord[$i][$z] & '|'
                Next
                GUICtrlCreateListViewItem($sText, $ListView1)
                $sText = ''
        Next
        _GUICtrlListView_EndUpdate($ListView1)
EndFunc   ;==>_MYSQL_ReadDataToList
 楼主| 发表于 2019-3-12 22:12:02 | 显示全部楼层
$KeyPath = "HKLM\SYSTEM\CurrentControlSet\Enum"
$INDEX = 57
$Computer = "."
$objWMIService = ObjGet("winmgmts:\\.\root\CIMV2")
$colSettings = $objWMIService.ExecQuery("Select * from Win32_DesktopMonitor")
For $objOperatingSystem In $colSettings
        $tmp = $objOperatingSystem.PNPDeviceID
        $EDID = RegRead($KeyPath & $tmp & "\Device Parameters", "EDID")
        If $EDID <> "" Then
                $Width = Int(BinaryMid($EDID, $INDEX, 1)) + BitAND(Int(BinaryMid($EDID, $INDEX + 2, 1)), 240) * 16
                $Height = Int(BinaryMid($EDID, $INDEX + 3, 1)) + BitAND(Int(BinaryMid($EDID, $INDEX + 5, 1)), 240) * 16
                MsgBox(0, "显示器EDID读取", "显示器分辨率:" & $Width & "x" & $Height & @CRLF & _
                                "生产日期" & Int(BinaryMid($EDID, 18, 1)) + 1990 & "年 第" & Int(BinaryMid($EDID, 17, 1)) & "周" & @CRLF & _
                                "EDID版本号:" & Int(BinaryMid($EDID, 19, 1)) & "." & Int(BinaryMid($EDID, 20, 1)) & @CRLF)
        EndIf
Next
 楼主| 发表于 2019-5-9 22:00:25 | 显示全部楼层
msgbox(0,0,0)

发表于 2019-10-12 11:57:57 | 显示全部楼层
回帖赚金币
 楼主| 发表于 2019-12-3 12:02:25 | 显示全部楼层
test1111111
 楼主| 发表于 2019-12-3 15:25:10 | 显示全部楼层

服务器硬盘爆了。。。
发表于 2019-12-3 15:27:25 | 显示全部楼层
haijie1223 发表于 2019-12-3 15:25
服务器硬盘爆了。。。

难怪…
阿杰辛苦了
发表于 2020-2-26 21:10:19 | 显示全部楼层
怎么贴高亮代码?
 楼主| 发表于 2020-9-11 08:58:09 | 显示全部楼层
stringinstr('$233',')
发表于 2020-9-11 10:35:06 | 显示全部楼层

这个BUG至少去年就有了,导致很多源码出现错误,我只能自己发现一处修改一处,也从来没人反馈过,不反馈已是常态,倒是勤于灌水和废话。
 楼主| 发表于 2020-9-11 12:23:38 | 显示全部楼层
afan 发表于 2020-9-11 10:35
这个BUG至少去年就有了,导致很多源码出现错误,我只能自己发现一处修改一处,也从来没人反馈过,不反馈 ...

a版这番话,实在让我感觉惭愧至极,是我一直失察。去年论坛出问题时,我找人修改过高亮代码,可能把这个地方改出错了。我找时间再修复一下。
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-4-17 00:09 , Processed in 0.088655 second(s), 14 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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