943,670 Members | Top Members by Rank

Ad:
  • C# Discussion Thread
  • Marked Solved
  • Views: 4620
  • C# RSS
Apr 8th, 2009
0

Given a subnet mask, how to verify if an IP falls in that subnet.

Expand Post »
Hi, I have a scenario wherein I need to give access of a system to the hosts of a subnet. For that I need to verify if the incoming request is from the IP which falls within the subnet. Is there some way to do that automatically using c# functionality.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
beckman16 is offline Offline
6 posts
since Sep 2008
Apr 8th, 2009
0

Re: Given a subnet mask, how to verify if an IP falls in that subnet.

subnet info is not embedded to ip address, it is not in that context.
subnet mask can be anything for a given ip address. subnet masks are used to group ip addresses. what you can know about ip address could only be its type like a,b or c.
Featured Poster
Reputation Points: 854
Solved Threads: 127
Banned
serkan sendur is offline Offline
2,057 posts
since Jan 2008
Apr 8th, 2009
0

Re: Given a subnet mask, how to verify if an IP falls in that subnet.

It is like with given subnet 255.255.255.224, its not possible to have a host with IP 192.168.10.32.
Last edited by beckman16; Apr 8th, 2009 at 4:15 pm.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
beckman16 is offline Offline
6 posts
since Sep 2008
Apr 9th, 2009
0

Re: Given a subnet mask, how to verify if an IP falls in that subnet.

Check this cool bit of code out:

http://blogs.msdn.com/knom/archive/2...-networks.aspx

This guy has a pretty slick solution!
Team Colleague
Reputation Points: 186
Solved Threads: 147
Cookie... That's it
alc6379 is offline Offline
2,519 posts
since Dec 2003

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C# Forum Timeline: Trouble with dataGridViewButtonColumn event
Next Thread in C# Forum Timeline: Popup Outlook contact makes the WinForm stuck and frozen





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC