Public Class Form1
Declare Function SetBilgisayarAd Lib "kernel32" _
Alias "SetComputerNameA" (ByVal lpBilgisayarAd As String) As _
Long
Public Function BilgisayarAdiniDegistir(ByVal YeniBilgisayarAd As String) _
As Boolean
On Error Resume Next
Dim nReturn As Long
nReturn = SetBilgisayarAd(YeniBilgisayarAd)
If Err.Number = 0 Then
BilgisayarAdiniDegistir = nReturn <> 0
End If
End Function
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
BilgisayarAdiniDegistir(TextBox1.Text)
End Sub
End Class
0 comments:
Yorum Gönder