Question about System.Net.IPAddress, do we have SetAddressBytes ?

  • Thread starter Thread starter Hobbs
  • Start date Start date
H

Hobbs

Suppose I have an ip number such as

10.11.12.13
and I want to change the 13 to 14
how do I do that?

For example, I have

Dim ip As System.Net.IPAddress
' code to assign a value to 'ip'
Dim AdrBytes() As Byte = ip.GetAddressBytes
AdrBytes(3)=14

how do I reassign the array 'bytes' into the 'ip' reference type ?

In other words, I need the reverse of getAddressBytes, SetAddressBytes ?

Tia
 
One way is to create another instance from the modified byte array.
Dim ip2 As New IPAddress(AdrBytes)


hope that helps..
Imran.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top