0

If-statement チェックを行う方法を知りたいのですmyClientMachineIpが、(コードから) if がAddressFamily.InterNetwork?

私の現在のコード:

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Dim myClientMachineAddressList As IPHostEntry = System.Net.Dns.GetHostEntry(System.Net.Dns.GetHostName())
        Dim myClientMachineIP As String = myClientMachineAddressList.AddressList(0).ToString()

        If myClientMachineIP = AddressFamily.InterNetwork Then
            TextBox1.Text = myClientMachineIP
        Else
            TextBox1.Text = "IP does not equal to IPv4"

        End If
    End Sub
4

1 に答える 1