728x90
GetSystemInfo함수는 Computer System의 각종 정보를 알아내는 API함수입니다.
Declare Sub GetSystemInfo Lib "kernel32" Alias "GetSystemInfo" (ByRef SystemInfo As _SYSTEMINFO)
Structure _SYSTEMINFO
Public iOem As Integer
Public iPgSize As Integer
Public iApp_min_addr As Integer
Public iApp_max_addr As Integer
Public iActive_prs_mak As Integer
Public iPrs_number As Integer
Public iPrs_type As Integer
Public iGranularity As Integer
Public iRsed As Integer
End Structure
Dim GetInfo As _SYSTEMINFO
Call GetSystemInfo(GetInfo)
GetInfo.iOem.ToString.Trim()
GetInfo.iPgSize.ToString.Trim()
GetInfo.iApp_min_addr.ToString.Trim()
GetInfo.iApp_max_addr.ToString.Trim()
GetInfo.iActive_prs_mak.ToString.Trim()
GetInfo.iPrs_number.ToString.Trim()
GetInfo.iPrs_type.ToString.Trim()
GetInfo.iGranularity.ToString.Trim()
GetInfo.iRsed.ToString.Trim()
▶VB.NET
[System.Runtime.InteropServices.DllImport("kernel32.dll")]
private static extern void GetSystemInfo(ref _SYSTEMINFO SystemInfo);
struct _SYSTEMINFO{
public int iOem;
public int iPgSize;
public int iApp_min_addr;
public int iApp_max_addr;
public int iActive_prs_mak;
public int iPrs_number;
public int iPrs_type;
public int iGranularity;
public int iRsed;
};
_SYSTEMINFO GetInfo = default(_SYSTEMINFO);
GetSystemInfo(ref GetInfo);
GetInfo.iOem.ToString().Trim();
GetInfo.iPgSize.ToString().Trim();
GetInfo.iApp_min_addr.ToString().Trim();
GetInfo.iApp_max_addr.ToString().Trim();
GetInfo.iActive_prs_mak.ToString().Trim();
GetInfo.iPrs_number.ToString().Trim();
GetInfo.iPrs_type.ToString().Trim();
GetInfo.iGranularity.ToString().Trim();
GetInfo.iRsed.ToString().Trim();
▶C#
GetSystemInfo함수는 인수로 주어지는 구조체에 값을 저장합니다.
728x90
'.NET > Windows API for .NET' 카테고리의 다른 글
SetParent - 부모 Window변경 (0) | 2019.08.06 |
---|---|
ReleaseDC - Device Context 초기화 (0) | 2019.08.06 |
ExitWindowsEx - System종료및 Logoff 하기 (0) | 2019.08.06 |
WindowFromPoint - 위치에 따른 Window의 Handle값 취득 (0) | 2019.08.06 |
SetSystemTime - System날짜및 시간설정 (0) | 2019.08.06 |