Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
catHardware
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
陶腾飞
catHardware
Commits
4300faf8
Commit
4300faf8
authored
Apr 02, 2022
by
陶腾飞
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2022-04-22
parent
dfb647c1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
6 deletions
+19
-6
README.md
+4
-2
main.go
+15
-4
No files found.
README.md
View file @
4300faf8
...
...
@@ -40,4 +40,6 @@ Get-PhysicalDisk
2022年3月26日:增加内存的DDR信息
2022年3月27日:加快CPU获取信息的速度
\ No newline at end of file
2022年3月27日:加快CPU获取信息的速度
2022年4月2日:跳过MSVD,增加对DDR4的判断
\ No newline at end of file
main.go
View file @
4300faf8
...
...
@@ -149,6 +149,12 @@ func getHardwareMemoryForPS() ([]int, []string, []string, int) {
m
=
"DDR3"
case
"26"
:
m
=
"DDR4"
case
"0"
:
if
i
,
err
:=
strconv
.
Atoi
(
Speed
[
j
]);
err
!=
nil
{
m
=
""
}
else
if
i
>=
2133
{
m
=
"DDR4"
}
default
:
m
=
""
}
...
...
@@ -166,7 +172,6 @@ func getHardwareMemoryForPS() ([]int, []string, []string, int) {
}
return
Capacity
,
Speed
,
MemoryType
,
j
-
1
}
func
getHardwareHardDiskForPS
(
mini
bool
)
([]
string
,
[]
int64
,
[]
string
,
int
)
{
MediaType
:=
make
([]
string
,
2
)
FriendlyName
:=
make
([]
string
,
2
)
...
...
@@ -184,6 +189,10 @@ func getHardwareHardDiskForPS(mini bool) ([]string, []int64, []string, int) {
m
=
"固态硬盘"
case
"HDD"
:
m
=
"机械硬盘"
// 跳过U盘
case
"Unspecified"
:
// 2+1后开始重置
c
=
2
}
}
...
...
@@ -203,6 +212,10 @@ func getHardwareHardDiskForPS(mini bool) ([]string, []int64, []string, int) {
FriendlyName
[
j
]
=
m
}
// 跳过虚拟硬盘
if
FriendlyName
[
j
]
==
"Msft Virtual Disk"
{
c
=
2
}
c
++
}
else
if
strings
.
Index
(
line
,
"Size"
)
!=
-
1
{
Size
:=
strings
.
TrimSpace
(
strings
.
Split
(
line
,
":"
)[
1
])
...
...
@@ -223,9 +236,7 @@ func getHardwareHardDiskForPS(mini bool) ([]string, []int64, []string, int) {
}
}
// for i := 0; i <= j; i++ {
// fmt.Printf("%s %dGB %s\n", FriendlyName[i], Sizen[i], MediaType[i])
// }
return
FriendlyName
,
Sizen
,
MediaType
,
j
-
1
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment