简体   繁体   中英

How to get subnet mask using .net?

I want to get client subnet mask using c#.

How can I get it?

First of all, check NetworkInterface class first. There are a lot of information in it. And these articles will be helpful for you:

It's impossible to know what subnet mask client's network is using (if we are talking about D and E class IP addresses).

My assumption is that by "client" you mean a remote computer connected to your server. Otherwise see @Soner Gönül answer.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM