VB.Net by API/System.Net/IPAddress

Материал из VB Эксперт
Перейти к: навигация, поиск

IPAddress.Equals

  
Imports System.Net
Public Class Tester
    Public Shared Sub Main
        Dim ipAddr1 As IPAddress = IPAddress.Parse("192.168.1.100")
        Dim ipAddr2 As IPAddress = IPAddress.Parse("192.168.1.100")
    
        If ipAddr1.Equals(ipAddr2) Then
          Console.WriteLine("equal")
        Else
          Console.WriteLine("different")
        End If
    End Sub
End Class


IPAddress.Parse

  
Imports System.Net
Public Class Tester
    Public Shared Sub Main
        Dim ipAddr1 As IPAddress = IPAddress.Parse("192.168.1.100")
        Dim ipAddr2 As IPAddress = IPAddress.Parse("192.168.1.100")
    
        If ipAddr1.Equals(ipAddr2) Then
          Console.WriteLine("equal")
        Else
          Console.WriteLine("different")
        End If
    End Sub
End Class