Set oRegistry = GetObject("winmgmts:{impersonationLevel=impersonate}!\\./root/default:StdRegProv")
Call oRegistry.EnumKey(&H80000002, "System\CurrentControlSet\Enum\Display\", SubKeys1)
For Each SubKey1 In SubKeys1
Call oRegistry.EnumKey(&H80000002, "System\CurrentControlSet\Enum\Display\" & SubKey1 & "\", SubKeys2)
For Each SubKey2 In SubKeys2
Call oRegistry.GetMultiStringValue(&H80000002, "System\CurrentControlSet\Enum\Display\" & SubKey1 & "\" & SubKey2 & "\", "HardwareID", svalue)
For tmpctr = 0 To UBound(svalue)
If LCase(Left(svalue(tmpctr), 8)) = "monitor\" Then
Call oRegistry.EnumKey(&H80000002, "System\CurrentControlSet\Enum\Display\" & SubKey1 & "\" & SubKey2 & "\", SubKeys3)
For Each SubKey3 In SubKeys3
If SubKey3 = "Control" Then
Call oRegistry.GetBinaryValue(&H80000002, "System\CurrentControlSet\Enum\Display\" & SubKey1 & "\" & SubKey2 & "\" & "Device Parameters\", "EDID", MonitorParameter)
If VarType(MonitorParameter) <> 8204 Then
VsMonitor = "EDID Not Available"
Else
For Each bytevalue In MonitorParameter
VsMonitor = VsMonitor & Chr(bytevalue)
Next
End If
ReDim Preserve strarrRawEDID(intMonitorCount)
strarrRawEDID(intMonitorCount) = VsMonitor
intMonitorCount = intMonitorCount + 1
End If
Next
End If
Next
Next
Next
Call oRegistry.EnumKey(&H80000002, "System\CurrentControlSet\Enum\Display\", SubKeys1)
For Each SubKey1 In SubKeys1
Call oRegistry.EnumKey(&H80000002, "System\CurrentControlSet\Enum\Display\" & SubKey1 & "\", SubKeys2)
For Each SubKey2 In SubKeys2
Call oRegistry.GetMultiStringValue(&H80000002, "System\CurrentControlSet\Enum\Display\" & SubKey1 & "\" & SubKey2 & "\", "HardwareID", svalue)
For tmpctr = 0 To UBound(svalue)
If LCase(Left(svalue(tmpctr), 8)) = "monitor\" Then
Call oRegistry.EnumKey(&H80000002, "System\CurrentControlSet\Enum\Display\" & SubKey1 & "\" & SubKey2 & "\", SubKeys3)
For Each SubKey3 In SubKeys3
If SubKey3 = "Control" Then
Call oRegistry.GetBinaryValue(&H80000002, "System\CurrentControlSet\Enum\Display\" & SubKey1 & "\" & SubKey2 & "\" & "Device Parameters\", "EDID", MonitorParameter)
If VarType(MonitorParameter) <> 8204 Then
VsMonitor = "EDID Not Available"
Else
For Each bytevalue In MonitorParameter
VsMonitor = VsMonitor & Chr(bytevalue)
Next
End If
ReDim Preserve strarrRawEDID(intMonitorCount)
strarrRawEDID(intMonitorCount) = VsMonitor
intMonitorCount = intMonitorCount + 1
End If
Next
End If
Next
Next
Next
解决方案 »
- 控件切换了,快捷键没切换过来,怎么回事?
- .net网站发布后,一访问网站就关闭IIS应用程序池,求解决方案
- c#咋样截取中文
- C#控制台应用程序的几个问题
- (高分求解)在编辑环境下如果屏蔽form的load事件(急...)
- 关于调用外部程序
- 假设有一个WEB程序,需要用到一个DLL,这个DLL负责读写客户端的文件.这要怎样实施????做成ACTIVEX??
- 谁能帮我解释一下1000224E F3 A5 rep movs dword ptr [edi],dword ptr [esi]
- Dns.GetHostEntry(String)方法为什么执行好久才有反应
- 如何生成.key格式的许可证文件
- C# WinFrom 如何实现左侧的导航项,请各大大指点
- 除了GetPixel 还有没有其他方法来取得屏幕的查个点的颜色,谢谢
object[] method_args = new object[] { 0x80000002, @"System\CurrentControlSet\Enum\Display\",null };
mClass.InvokeMethod("EnumKey", method_args);
SubKeys1 = (string[])method_args[2];
foreach (var SubKey1 in SubKeys1)
{
object[] method_args1 = new object[] { 0x80000002, @"System\CurrentControlSet\Enum\Display\" + SubKey1+@"\", null};
mClass.InvokeMethod("EnumKey", method_args1);
SubKeys2 = (string[])method_args1[2];
foreach (var SubKey2 in SubKeys2)
{
ManagementBaseObject inParams = mClass.GetMethodParameters("GetStringValue");
inParams["hDefKey"] = 0x80000002;
inParams["sSubKeyName"] = @"System\CurrentControlSet\Enum\Display\" + SubKey1 + @"\" + SubKey2 + @"\";
inParams["sValueName"] = "HardwareID";
ManagementBaseObject curRes = mClass.InvokeMethod("GetStringValue", inParams, null);
svalue = curRes["sValue"].ToString(); 这个取不到值
object[] method_args2 = new object[] { 0x80000002, @"System\CurrentControlSet\Enum\Display\" + SubKey1 + @"\" + SubKey2 + @"\", null };
mClass.InvokeMethod("EnumKey", method_args2);
SubKeys3 = (string[])method_args2[2];
foreach (var SubKey3 in SubKeys3)
{
if (SubKey3 == "Control")
{
ManagementBaseObject inParams1 = mClass.GetMethodParameters("GetStringValue");
inParams1["hDefKey"] = 0x80000002;
inParams1["sSubKeyName"] = @"System\CurrentControlSet\Enum\Display\" + SubKey1 + @"\" + SubKey2 + @"\"+@"Device Parameters\";
inParams1["sValueName"] = "EDID";
ManagementBaseObject curRes1 = mClass.InvokeMethod("GetStringValue", inParams1, null);
svalue = curRes1["sValue"].ToString(); 这个取不到值 if (curRes1["sValue"] == null)
{
if(MonitorParameter!="8024")
{
VsMonitor = "EDID Not Available";
}
else
{
foreach(var bytevalue in MonitorParameter)
{
VsMonitor = VsMonitor + bytevalue.ToString();
}
}
}
strarrRawEDID[intMonitorCount] = VsMonitor;
intMonitorCount = intMonitorCount + 1;
}
}
}
}