Q

Performing binary calculation on the IP address

I am developing a program in Visual Basic.NET for a class that I am taking and I would like to see if I can get some guidance. What I am doing is developing a program where I can take a class A,B, or C IP address and Subnet form that address. I will need to verify subnet masks, and develop the formula to Subnet. I am new to this and have reached a barrier here on this portion of the program. Any help would be greatly appreciated. I'm...

not exactly sure what the goal of the application is, because I'm not sure what you mean by "formula to subnet." Well, I'm sure they want you to perform some binary calculation on the IP address. Your best bet is probably to use, and possibly extend, the System.Net.IPAddress class. Here's the related page in MSDN: http://msdn.microsoft.com/library/en-us/cpref/html/frlrfsystemnetipaddressclasstopic.asp.

You can use the IPAddress.Parse() method to accept a standard x.x.x.x IP address format, and then use GetAddressBytes() to get the IP address' four bytes for binary processing.

This was first published in April 2004
This Content Component encountered an error

Pro+

Features

Enjoy the benefits of Pro+ membership, learn more and join.

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

-ADS BY GOOGLE

SearchServerVirtualization

SearchCloudComputing

SearchExchange

SearchSQLServer

SearchWinIT

SearchEnterpriseDesktop

SearchVirtualDesktop

Close