haijie1223
发表于 2019-3-10 23:32:00
html\test\\111
yuantian
发表于 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
haijie1223
发表于 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
haijie1223
发表于 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
$aValue = (@YEAR & @MON & @MDAY & @HOUR & @MIN & @SEC & @MSEC)
$aValue = '添加数据 - ' & Random(100, 999, 1)
$aValue = '添加数据 - ' & Random(100, 999, 1)
$aValue = '添加数据 - ' & Random(100, 999, 1)
$aValue = '添加数据 - ' & Random(100, 999, 1)
$aValue = '添加数据 - ' & 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 ; 需要更新数据的列名,位置与下面的更新的值对齐,数量必须相同。
$aColumn = 'ID'
$aColumn = '第一列'
$aColumn = '第二列'
$aColumn = '第三列'
$aColumn = '第四列'
$aColumn = '第五列'
Local $aNewValue ; 新的数据,位置与上面的列对齐,数量必须相同。
$aNewValue = $iNumber
$aNewValue = '更新数据 - ' & Random(100, 999, 1)
$aNewValue = '更新数据 - ' & Random(100, 999, 1)
$aNewValue = '更新数据 - ' & Random(100, 999, 1)
$aNewValue = '更新数据 - ' & Random(100, 999, 1)
$aNewValue = '更新数据 - ' & Random(100, 999, 1)
;~ $aNewValue = Random(100, 9999, 1)
;~ $aNewValue = Random(100, 9999, 1)
;~ $aNewValue = Random(100, 9999, 1)
;~ $aNewValue = Random(100, 9999, 1)
;~ $aNewValue = 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
haijie1223
发表于 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
haijie1223
发表于 2019-5-9 22:00:25
msgbox(0,0,0)
v2482230
发表于 2019-10-12 11:57:57
回帖赚金币
haijie1223
发表于 2019-12-3 12:02:25
test1111111
afan
发表于 2019-12-3 12:03:43
抽风 :face (31):
haijie1223
发表于 2019-12-3 15:25:10
afan 发表于 2019-12-3 12:03
抽风
服务器硬盘爆了。。。
afan
发表于 2019-12-3 15:27:25
haijie1223 发表于 2019-12-3 15:25
服务器硬盘爆了。。。
难怪…
阿杰辛苦了 :face (2):
bfgxp
发表于 2020-2-26 21:10:19
怎么贴高亮代码?
haijie1223
发表于 2020-9-11 08:58:09
stringinstr('$233',')
afan
发表于 2020-9-11 10:35:06
haijie1223 发表于 2020-9-11 08:58
这个BUG至少去年就有了,导致很多源码出现错误,我只能自己发现一处修改一处,也从来没人反馈过,不反馈已是常态,倒是勤于灌水和废话。
haijie1223
发表于 2020-9-11 12:23:38
afan 发表于 2020-9-11 10:35
这个BUG至少去年就有了,导致很多源码出现错误,我只能自己发现一处修改一处,也从来没人反馈过,不反馈 ...
a版这番话,实在让我感觉惭愧至极,是我一直失察。去年论坛出问题时,我找人修改过高亮代码,可能把这个地方改出错了。我找时间再修复一下。