By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,288 Members | 1,243 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,288 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
Nov 21 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
One way is to create another instance from the modified byte array.
Dim ip2 As New IPAddress(AdrBytes)
hope that helps..
Imran.

"Hobbs" <mnnnnmnmnn> wrote in message
news:ej**************@TK2MSFTNGP10.phx.gbl...
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

Nov 21 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.