컴퓨터 이름 ,맥주소 가져오기
*
Imports System.Net.NetworkInformation
Public Class Form1

Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
Dim myComName As String = Environment.MachineName
Dim myMac As String = getMacAddress()
Label1.Text = myMac & "_" & myComName
End Sub

Function getMacAddress()
Dim nics() As NetworkInterface = _
NetworkInterface.GetAllNetworkInterfaces
Return nics(0).GetPhysicalAddress.ToString
End Function
End Class

Imports System.Net.NetworkInformation
Public Class Form1

    Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
        Dim myComName As String = Environment.MachineName
        Dim myMac As String = getMacAddress()
        Label1.Text = myMac & "_" & myComName
    End Sub

    Function getMacAddress()
        Dim nics() As NetworkInterface = _
              NetworkInterface.GetAllNetworkInterfaces
        Return nics(0).GetPhysicalAddress.ToString
    End Function
End Class
 

이 게시물을

댓글'1'
VNote (작성자)
  • 2017.11.12
  • 수정: 2017.11.12 07:53:11

    Dim os() As String
    Dim myuser() As String
    Private Sub Form2_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
        os = My.Computer.Info.OSFullName.Split(" ")
        myuser = My.User.Name.Split("\")
        Label1.Text = os(2)
        Label2.Text = myuser(1)
    End Sub
 

 

1.PNG

 

이 댓글을

공유하기

SEARCH

MENU NAVIGATION