Calculate Network Address

Here is a little console application I created that can take an ip and subnet mask and give you the network address. 

Module Module1

    Sub Main()
        Console.WriteLine("Enter the IP address")
        Dim sIP As String = Console.ReadLine()
        Console.WriteLine("Enter Subnet Mask")
        Dim sSubnetMask As String = Console.ReadLine()
        Dim ip() As String = sIP.Split(".")
        Dim subnetmask() As String = sSubnetMask.Split(".")
        Console.WriteLine("The network address is:")
        For i As Integer = 0 To 3
            If i > 0 Then
            End If
            Console.Write(ip(i) and subnetmask(i))
    End Sub

End Module

EDIT: I was really not thinking clearly when I wrote the original.  Thanks to TheMoof for pointing this out.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s