클리엘
CLIEL LAB
클리엘
전체 방문자
오늘
어제
  • 분류 전체보기 (514) N
    • Mobile (47)
      • Kotlin (47)
    • Web (84)
      • NestJS (9)
      • HTML5 & CSS3 (38)
      • Javascript (20)
      • TypeScript (6)
      • JQuery (11)
    • .NET (301) N
      • C# (84) N
      • ASP.NET (67)
      • Windows API for .NET (128)
    • Server (53)
      • SQL Server (10)
      • MariaDB (18)
      • Windows Server (6)
      • node.js (19)
    • System (12)
      • 작업LOG (12)
    • Review (11)
    • ETC (6)

블로그 메뉴

  • 홈
  • 태그
  • 방명록

공지사항

  • 블로그 정리

인기 글

태그

  • exception
  • Entity Framework
  • MariaDB
  • jQuery
  • android
  • LINQ
  • Windows API
  • CSS3
  • NestJS
  • ASP.NET
  • Kotlin
  • HTML5
  • c#
  • .NET
  • asp.net core
  • asp.net core web api
  • android studio
  • JavaScript
  • node.js
  • 변수

최근 댓글

최근 글

티스토리

hELLO · Designed By 정상우.
클리엘

CLIEL LAB

.NET/Windows API for .NET

GetSystemInfo - System 정보조회

2019. 8. 6. 16:14
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
    '.NET/Windows API for .NET' 카테고리의 다른 글
    • SetParent - 부모 Window변경
    • ReleaseDC - Device Context 초기화
    • ExitWindowsEx - System종료및 Logoff 하기
    • WindowFromPoint - 위치에 따른 Window의 Handle값 취득
    클리엘
    클리엘
    누구냐 넌?

    티스토리툴바