473,399 Members | 4,192 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

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

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
1 1258
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Richard L Rosenheim | last post by:
I'm playing around with setting up a multicast socket. I can create a socket for sending, and I can one that receives. Is it possible to create one socket that can do both? The code I've been...
12
by: Taylor | last post by:
I'm trying to understand inheritance. I'd like to make my own type of IPAddress lets call it myIp. The following gives me CS0029 error: Cannot implicitly convert type 'System.Net.IPAddress' to...
1
by: Ray Mitchell | last post by:
Hello, I've inherited the following code and am trying to get it to work. As I understand it's purpose, it creates a server, listens for a client to connect, does some work with the client,...
4
by: zbcong | last post by:
Hello: I write a multithread c# socket server,it is a winform application,there is a richtextbox control and button,when the button is click,the server begin to listen the socket port,waiting for a...
5
by: Naveen Mukkelli | last post by:
Hi all, How can we use "NUnit" in socket programming. I mean, I'm writing a server program which accepts connection requests from the clients. I want to test the number of clients whenever a...
12
by: Brian Henry | last post by:
I wrote a simple client / server app (nothing major, just sends text) it works fine locally on the same system, but once i move the client to a remote system it errors and gives me "No connection...
1
by: Brian Henry | last post by:
Hello, I was tring to learn socket's (being i never used them before) and have a simple question. I want to create a listner that will get any data recieved and print it out. I've been able to...
4
by: Nuno Magalhaes | last post by:
One thing I've noticed is that if I try that code on a simple form load event it works ok like this: ....form load event... Socket socket=new...
2
by: O.B. | last post by:
I have a an attribute within a Serializable class that is of type System.Net.IPAddress. When I try to serialize the class, I get the following error: System.InvalidOperationException: Cannot...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.