Results 1 to 11 of 11

Thread: [RESOLVED] [2008] Subnet Scan

Threaded View

  1. #7
    Powered By Medtronic dbasnett's Avatar
    Join Date
    Dec 2007
    Location
    Jefferson City, MO
    Posts
    9,897

    Re: [2008] Subnet Scan

    if the first address is 10.158.0.1, and the mask is 255.255.252.0 then
    Code:
    Host/Net - 1022 = 1024 - 1 for network# and - 1 for directed broadcast.
    Network          Broadcast
    10.158.0.0       10.158.3.255
    
    IP        00001010 10011110 00000000 00000001 10.158.0.1
    Mask      11111111 11111111 11111100 00000000 255.255.252.0
    Net       00001010 10011110 00000000 00000000 10.158.0.0
    Hosts     00000000 00000000 00000011 11111111 1023
    CIDR      22
    the first available address is 10.158.0.1, and the last possible address is 10.158.3.254, not 2.254.

    copy the code i provided to a module.

    then insert this into your code
    Code:
            Dim RetStr As List(Of String)
            RetStr = ipRange("10.158.0.1", "255.255.252.0")
    
            For nn As Integer = 0 To RetStr.Count - 1
                Debug.WriteLine(RetStr(nn)) 'show the results
                ' My.Computer.Network.Ping(RetStr(nn))
            Next
    Last edited by dbasnett; Nov 11th, 2008 at 04:55 PM.
    My First Computer -- Documentation Link (RT?M) -- Using the Debugger -- Prime Number Sieve
    Counting Bits -- Subnet Calculator -- UI Guidelines -- >> SerialPort Answer <<

    "Those who use Application.DoEvents have no idea what it does and those who know what it does never use it." John Wein

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width