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 ();
}