473,507 Members | 11,372 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

IP Addresses

Hope someone can help me out here.

I'm writing some code to see where a specific domain name resolves and
if its not a local address, redirect to a specific redirect page.

<code>
IPHostEntry IPHost = Dns.Resolve("www.domainname.com");
IPAddress[] addr = IPHost.AddressList;
for (int i = 0;i < addr.Length;i++)
{
Response.Write(addr[i] + "<br/>");
}
</code>

That code works fine.
Now, local IP addresses are:

10.0.0.0 - 10.255.255.255
172.16.0.0 - 172.31.0.0
192.168.0.0 - 192.168.255.0

is there a built in function in C# that's effectively a
'isLocalIPaddress()' ? Or do I have to code this the long way round on
each individual octect of the given IP of the domain name?

Nov 17 '05 #1
0 863

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
3313
by: Hoang | last post by:
anyone know of an algorithm to filter out real email addresses as opposed to computer generated email addresses? I have been going through past email archives in order to find friends email...
17
14021
by: Andrew McLean | last post by:
I have a problem that is suspect isn't unusual and I'm looking to see if there is any code available to help. I've Googled without success. Basically, I have two databases containing lists of...
2
1656
by: Not Me | last post by:
Hi, I've been having this problem for a while now and seem to be getting closer to a solution but it's still not perfect. I have a table of addresses, people (refno's) may have more than one...
1
4250
by: Lyle Fairfield | last post by:
Option Explicit ' requires VBScript to be installed ' (maybe don't give this to your sugnificant other as ' it gets deleted addresses as well as current) ' obvious fixups needed '1. how get...
4
5072
by: =?Utf-8?B?U2VyZ2Vp?= | last post by:
Dear staff Can I get your assistance with \3GB (LARGEADDRESSAWARE) switch in mixed mode process built by VS 2008, please? I have a mixed mode application: C# GUI calling native C++ DLL through...
0
7109
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
7372
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7029
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
5619
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,...
1
5039
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...
0
3179
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1537
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
758
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
411
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.