TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Momir Gostimir
NA
54
2.5k
CPU information label
Mar 31 2017 8:55 AM
Hi,
I am making a small winforms app that shows me system information. I have a problem when I use code below:
ManagementObjectSearcher procesor = new ManagementObjectSearcher("SELECT * FROM Win32_Proccesor");
string cpu = string.Empty;
foreach (ManagementObject mo in procesor.Get())
{
foreach (PropertyData property in mo.Properties)
{
if (property.Name == "Description")
{
cpu = property.Value.ToString();
}
}
}
cpuname.Text = cpu;
cpuname is my label that needs to change accordingly to cpu information that is provided from ManagmentObject. I get error: 'System.Management.ManagementException' occurred in System.Management.dll in --> foreach (ManagementObject mo in procesor.Get()) could you help me with this code?
Reply
Answers (
5
)
How to create buttons dynamically?
how to get database backup