Programming/Windows API
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함수는 인수로 주어지는 구조체에 값을 저장합니다.
0 0