如何在C#中检查某个ip范围内的IP地址? [英] How can I check whether an ip address in certain ip range in C#?

查看:205
本文介绍了如何在C#中检查某个ip范围内的IP地址?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好



我们怎样才能检查特定IP是否说194.66.82.11在C#中的范围是194.66.82.00和194.66.180.255。 />


提前致谢。



问候

Santhosh

Hi All

How can we check whether a particular IP say 194.66.82.11 is in a range of 194.66.82.00 and 194.66.180.255 in C#.

Thanks in advance.

Regards
Santhosh

推荐答案

见这里: http://stackoverflow.com/questions/2138706/how-to-check-a-input-ip-fall-in-a-specific-ip-range [ ^ ]


参见 http://stackoverflow.com/questions/2138706/how-to-check-a-input-ip-fall-in-a-specific-ip-range [< a href =http://stackoverflow.com/questions/2138706/how-to-check-a-input-ip-fall-in-a-specific-ip-range目标对于许多解决方案,=_ blanktitle =New Window> ^ ]。


将其拆分为四个字段并进行一些比较操作。您可以将每个四元组转换为整数以帮助解决问题。
Just split it into the four fields and do some compare operations. You could convert each quad to an integer to help things along.


这篇关于如何在C#中检查某个ip范围内的IP地址?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆