吾爱破解 - LCG - LSG |安卓破解|病毒分析|www.52pojie.cn

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 967|回复: 9
收起左侧

[求助] vb.net 取CPU型号和本地连接启用禁用的代码

[复制链接]
keeeeeen 发表于 2022-4-23 16:32
119吾爱币
求vb.net代码1.取CPU型号,不是CPUid,不是CPU序列号,是下图红色圈这种。
截图未命名.jpg
2.下图,本地连接,本地连接2网络重启,启用,禁用。或者网络服务禁用启动。用途是重启网络。
截图未命名.jpg
谢谢大佬
image.png

最佳答案

查看完整内容

勘误 应该是这个

发帖前要善用论坛搜索功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。

Todd 发表于 2022-4-23 16:32
Todd 发表于 2022-4-24 10:39
网络属性
用这个 Win32_NetworkAdapterConfiguration

勘误

应该是这个
1650769751(1).png
Todd 发表于 2022-4-23 18:58
PSComputerName                          : DESKTOP-MGDFEAP
Availability                            : 3
CpuStatus                               : 1
CurrentVoltage                          : 8
DeviceID                                : CPU0
ErrorCleared                            :
ErrorDescription                        :
LastErrorCode                           :
LoadPercentage                          : 4
Status                                  : OK
StatusInfo                              : 3
AddressWidth                            : 64
DataWidth                               : 64
ExtClock                                : 100
L2CacheSize                             : 1536
L2CacheSpeed                            :
MaxClockSpeed                           : 2208
PowerManagementSupported                : False
ProcessorType                           : 3
Revision                                :
SocketDesignation                       : U3E1
Version                                 :
VoltageCaps                             :
__GENUS                                 : 2
__CLASS                                 : Win32_Processor
__SUPERCLASS                            : CIM_Processor
__DYNASTY                               : CIM_ManagedSystemElement
__RELPATH                               : Win32_Processor.DeviceID="CPU0"
__PROPERTY_COUNT                        : 57
__DERIVATION                            : {CIM_Processor, CIM_LogicalDevice, CIM_LogicalElement, CIM_ManagedSystemEleme
                                          nt}
__SERVER                                : DESKTOP-MGDFEAP
__NAMESPACE                             : root\cimv2
__PATH                                  : \\DESKTOP-MGDFEAP\root\cimv2:Win32_Processor.DeviceID="CPU0"
Architecture                            : 9
AssetTag                                : To Be Filled By O.E.M.
Caption                                 : Intel64 Family 6 Model 158 Stepping 10
Characteristics                         : 252
ConfigManagerErrorCode                  :
ConfigManagerUserConfig                 :
CreationClassName                       : Win32_Processor
CurrentClockSpeed                       : 2208
Description                             : Intel64 Family 6 Model 158 Stepping 10
Family                                  : 198
InstallDate                             :
L3CacheSize                             : 9216
L3CacheSpeed                            : 0
Level                                   : 6
Manufacturer                            : GenuineIntel
Name                                    : Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
NumberOfCores                           : 6
NumberOfEnabledCore                     : 6
NumberOfLogicalProcessors               : 12
OtherFamilyDescription                  :
PartNumber                              : To Be Filled By O.E.M.
PNPDeviceID                             :
PowerManagementCapabilities             :
ProcessorId                             : BFEBFBFF000906EA
Role                                    : CPU
SecondLevelAddressTranslationExtensions : False
SerialNumber                            : To Be Filled By O.E.M.
Stepping                                :
SystemCreationClassName                 : Win32_ComputerSystem
SystemName                              : DESKTOP-MGDFEAP
ThreadCount                             : 12
UniqueId                                :
UpgradeMethod                           : 52
VirtualizationFirmwareEnabled           : False
VMMonitorModeExtensions                 : False
Scope                                   : System.Management.ManagementScope
Path                                    : \\DESKTOP-MGDFEAP\root\cimv2:Win32_Processor.DeviceID="CPU0"
Options                                 : System.Management.ObjectGetOptions
ClassPath                               : \\DESKTOP-MGDFEAP\root\cimv2:Win32_Processor
Properties                              : {AddressWidth, Architecture, AssetTag, Availability...}
SystemProperties                        : {__GENUS, __CLASS, __SUPERCLASS, __DYNASTY...}
Qualifiers                              : {dynamic, Locale, provider, UUID}
Site                                    :
Container                               :

需要什么属性 直接改


Sub CPU 属性()
    For Each 序列 In GetObject("Winmgmts:").InstancesOf("Win32_Processor")
        MsgBox "CPU 属性: " & CStr(序列.需要的属性)
    Next
End Sub




 楼主| keeeeeen 发表于 2022-4-23 21:51
本帖最后由 keeeeeen 于 2022-4-23 21:59 编辑
Todd 发表于 2022-4-23 18:58
PSComputerName                          : DESKTOP-MGDFEAP
Availability                            : ...

看到了,,,
zhhmok 发表于 2022-4-24 09:17
Todd 发表于 2022-4-23 18:58
PSComputerName                          : DESKTOP-MGDFEAP
Availability                            : ...

太厉害了!

网络部分呢?哪个属性
 楼主| keeeeeen 发表于 2022-4-24 09:34
zhhmok 发表于 2022-4-24 09:17
太厉害了!

网络部分呢?哪个属性

这是CPU 部分
Todd 发表于 2022-4-24 10:39
image.png
网络属性
用这个 Win32_NetworkAdapterConfiguration
 楼主| keeeeeen 发表于 2022-4-24 15:26
[Dynamic, Provider("CIMWin32"), UUID("{8502C4C0-5FBB-11D2-AAC1-006008C78BC7}"), AMENDMENT]
class Win32_NetworkAdapter : CIM_NetworkAdapter
{
  string   AdapterType;
  uint16   AdapterTypeID;
  boolean  AutoSense;
  uint16   Availability;
  string   Caption;
  uint32   ConfigManagerErrorCode;
  boolean  ConfigManagerUserConfig;
  string   CreationClassName;
  string   Description;
  string   DeviceID;
  boolean  ErrorCleared;
  string   ErrorDescription;
  string   GUID;
  uint32   Index;
  datetime InstallDate;
  boolean  Installed;
  uint32   InterfaceIndex;
  uint32   LastErrorCode;
  string   MACAddress;
  string   Manufacturer;
  uint32   MaxNumberControlled;
  uint64   MaxSpeed;
  string   Name;
  string   NetConnectionID;
  uint16   NetConnectionStatus;
  boolean  NetEnabled;
  string   NetworkAddresses[];
  string   PermanentAddress;
  boolean  PhysicalAdapter;
  string   PNPDeviceID;
  uint16   PowerManagementCapabilities[];
  boolean  PowerManagementSupported;
  string   ProductName;
  string   ServiceName;
  uint64   Speed;
  string   Status;
  uint16   StatusInfo;
  string   SystemCreationClassName;
  string   SystemName;
  datetime TimeOfLastReset;
};
 楼主| keeeeeen 发表于 2022-4-24 15:30
Todd 发表于 2022-4-24 11:08
勘误

应该是这个

谢谢大佬

学你查了一下,也验证了一下。

NetEnabled应该是有没有插网线或有没有连接WIFI,或有没有连接蓝牙

PhysicalAdapter应该是物理设备有没有启用
 楼主| keeeeeen 发表于 2022-4-24 15:35
谢谢各路大佬,学习了
一开始语句Dim colAdapters As New System.Management.ManagementObjectSearcher("Select * from Win32_NetworkAdapter where NetEnabled =ture")
不应该在colAdapters ,where..。导致没数据

Dim colAdapters As New System.Management.ManagementObjectSearcher("Select * from Win32_NetworkAdapter")
  For Each Adapter As ManagementObject In colAdapters.Get
                      MsgBox(Adapter("DeviceId") & Adapter("NetEnabled") & Adapter("NAME") & Adapter("NetConnectionID") & Adapter("PhysicalAdapter"))
            Next
才有数据。
您需要登录后才可以回帖 登录 | 注册[Register]

本版积分规则 警告:本版块禁止回复与主题无关非技术内容,违者重罚!

快速回复 收藏帖子 返回列表 搜索

RSS订阅|小黑屋|处罚记录|联系我们|吾爱破解 - LCG - LSG ( 京ICP备16042023号 | 京公网安备 11010502030087号 )

GMT+8, 2024-5-10 04:22

Powered by Discuz!

Copyright © 2001-2020, Tencent Cloud.

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