클리엘
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)

블로그 메뉴

  • 홈
  • 태그
  • 방명록

공지사항

  • 블로그 정리

인기 글

태그

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

최근 댓글

최근 글

티스토리

hELLO · Designed By 정상우.
클리엘

CLIEL LAB

.NET/Windows API for .NET

SetComputerName - Computer Network 이름 바꾸기

2019. 8. 9. 17:03
728x90
Declare Function SetComputerName Lib "Kernel32" Alias "SetComputerNameA" (ByVal IpComputerName As String) As Integer

▶C# 선언

If SetComputerName("OpenLab") = 0 Then
    MessageBox.Show("Computer 이름 바꾸기 실패")
Else
    MessageBox.Show("Computer 이름 바꾸기 성공")
End If

▶C# 호출

[System.Runtime.InteropServices.DllImport("Kernel32.dll")]
private static extern int SetComputerName(string IpComputerName);

▶VB.NET 선언

if (SetComputerName("OpenLab") == 0){
    MessageBox.Show("Computer 이름 바꾸기 실패");
}
else{
    MessageBox.Show("Computer 이름 바꾸기 성공");
}

▶VB.NET 호출


SetComputerName는 해당 Computer의 이름을 바꾸지만 바뀐이름은 Computer가 재부팅된 이후부터 적용됩니다.

728x90
저작자표시 비영리 변경금지 (새창열림)

'.NET > Windows API for .NET' 카테고리의 다른 글

CopyMemory - Memory 복사  (0) 2019.08.12
SystemParameterInfo - Windows System 환경설정  (0) 2019.08.12
GetWindowsDirectory - 운영체제 설치경로  (0) 2019.08.09
GetUseName - 현재 윈도우 사용자 이름 구하기  (0) 2019.08.09
GetkeyboardType - 키보드 관련 정보확인  (0) 2019.08.09
    '.NET/Windows API for .NET' 카테고리의 다른 글
    • CopyMemory - Memory 복사
    • SystemParameterInfo - Windows System 환경설정
    • GetWindowsDirectory - 운영체제 설치경로
    • GetUseName - 현재 윈도우 사용자 이름 구하기
    클리엘
    클리엘
    누구냐 넌?

    티스토리툴바