How to Use wmi in C # to obtain operating system information ?,

Source: Internet
Author: User

How to Use wmi in C # to obtain operating system information ?,

 

Recently, the storage pool and ISCSI Disk technology in windows server 2012 operating system were used in the project. In the early stage, the entire operation was implemented using the power shell script. It is inconvenient to use the wmi API later.

The following lists all wmi namespaces and sample websites, which are worth your favorites! The examples in the project will be supplemented in the future.

Note: http://wutils.com/wmi/


For C Language

While (c = getchar ())! = '\ N ')
This sentence
You can understand it
When the system function getchar is reading characters
No line breaks
Press ENTER
Then the loop continues
If (c> = 'A' & c <= 'Z') | (c> = 'A' & c <= 'Z '))
This is the big condition of if.
You must enter one of the 26 letters
Case Insensitive
Last question
I'm a little dizzy.
I don't know why LZ is working with V.
If (c> 'Z' & c <= 'Z' + 4 | c> 'Z ')
This sentence is equivalent to if (c> = 'A' & c <= 'Z ') | (c> = 'A' & c <= 'Z') The second condition of the else if statement chain

For C Language

# Include <stdio. h>
Void main ()
{Char c;
Int I, j, k, z;
I = 0;
J = 0;
K = 0;
Z = 0;

While (c = getchar ())! = '\ N ')
{
If (c> = 'A' & c <= 'Z') | (c> = 'A' & c <= 'Z '))
I ++;
Else if (c> = '0' & c <= '9 ')
J ++;
Else if (c = 32)
K ++;
Else
Z ++;
}
Printf ("% d \ t % d", I, j, k, z );
Getch ();
}

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.