如何判断一个网址是企业内部网网址是什么? [英] How to tell if a URL is an intranet url?
问题描述
使用C#如何将一个确定一个URL是一个企业内部网的网址?我想一些code做的东西,如果一个URL是一个Intranet 1 VS大众。
Using C# how would one determine if a URL is an intranet URL? I would like some code to do something if a URL is an intranet one vs public.
推荐答案
您不能隐含知道。如果你的企业内部网的网址看起来就像完全限定域名则很难说。告诉唯一的办法就是查询两种不同的DNS的服务器(你自己的和公共的)。如果这两个返回相同的结果,那么它是一个互联网域名。如果公共DNS服务器无法解析地址,那么它很可能是内部网域。
you cannot implicitely know. if your intranet urls look like fully qualified domain names then it's difficult to tell. the only way to tell is to query two different DNS-servers (your own and a public one). If both return the same result, then it's an internet domain. if the public DNS-server isn't able to resolve the address, then it's most likely an intranet domain.
这篇关于如何判断一个网址是企业内部网网址是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!