본문 바로가기

Programing (프로그래밍)/VB.NET

VB.NET - 각종 정보 출력하기

728x90
반응형

【 VB.NET 】


@ 각종 정보 출력하기

 



# Form1.vb

 

Public Class Form1

    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load

        If UBound(Diagnostics.Process.GetProcessesByName(Diagnostics.Process.GetCurrentProcess.ProcessName)) > 0 Then

            MsgBox("프로그램이 이미 실행중입니다!", MsgBoxStyle.Exclamation + MsgBoxStyle.OkOnly, Me.Text)

            End

        End If


        Label1.Text = "해상도 너비"

        TextBox1.Text = My.Computer.Screen.Bounds.Width

        Label2.Text = "해상도 높이"

        TextBox2.Text = My.Computer.Screen.Bounds.Height

        Label3.Text = "64비트 여부"

        If Environment.Is64BitOperatingSystem = True Then TextBox3.Text = "64bit" Else TextBox3.Text = "32bit"

        Label4.Text = "로컬시간"

        TextBox4.Text = My.Computer.Clock.LocalTime

        Label5.Text = "실행파일 디렉토리"

        TextBox5.Text = My.Computer.FileSystem.CurrentDirectory

        Label6.Text = "OS 풀네임"

        TextBox6.Text = My.Computer.Info.OSFullName

        Label7.Text = "OS 플랫폼"

        TextBox7.Text = My.Computer.Info.OSPlatform

        Label8.Text = "OS 버전"

        TextBox8.Text = My.Computer.Info.OSVersion

        Label9.Text = "컴퓨터이름"

        TextBox9.Text = My.Computer.Name

        Label10.Text = "인터넷 연결여부"

        TextBox10.Text = My.Computer.Network.IsAvailable

        Label11.Text = "모니터 이름"

        TextBox11.Text = My.Computer.Screen.DeviceName

        Label12.Text = "실행파일 디렉토리"

        TextBox12.Text = My.Application.Info.DirectoryPath

        Label13.Text = "사용문화권 이름"

        TextBox13.Text = My.Application.UICulture.Name

        Label14.Text = "사용자 이름"

        TextBox14.Text = My.User.Name

        Label15.Text = "현재 보안 주체"

        TextBox15.Text = My.User.CurrentPrincipal.Identity.Name

        Label16.Text = "현재 시간"

        TextBox16.Text = Date.Now

        Label17.Text = "현재 시간(세계시간기준)"

        TextBox17.Text = Date.UtcNow

    End Sub

End Class 

 

 

# 중복 실행 방지 부분

 

        If UBound(Diagnostics.Process.GetProcessesByName(Diagnostics.Process.GetCurrentProcess.ProcessName)) > 0 Then

            MsgBox("프로그램이 이미 실행중입니다!", MsgBoxStyle.Exclamation + MsgBoxStyle.OkOnly, Me.Text)

            End

        End If




728x90
반응형