如何通过有线或无线方式检查连接是否正常 [英] How to check if the connection is used by wire or wireless

查看:59
本文介绍了如何通过有线或无线方式检查连接是否正常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要检查连接的连接。

如果我的连接是无线的,那么会出现一个特定的图标,如果是有线的话,那么另一个图标就像在windows中一样。< br $> b $ b

我的尝试:



我已经用如何区分两者。

谢谢。

I need to check the connection with what it is connected.
if my connection is wireless then a specific icon will appear and if it is by cable then another icon will apppear like in windows.

What I have tried:

I already did the check with the cable but how to differentiate both.
Thank you.

推荐答案

NetworkInterface.GetAllNetworkInterfaces()(使用System.Net.NetworkInformation)应该完成这项工作:

https://msdn.microsoft.com /query/dev11.query?appId=Dev11IDEF1&l=DE-DE&k=k(NetworkInterface.GetAllNetworkInterfaces);k(TargetFrameworkMoniker-.NETFramework,Version%3Dv4.5);k(DevLang-csharp)&rd= true [ ^ ]



您可以在此处找到一个示例:

NetworkInterface-Klasse(System.Net) .NetworkInformation) [ ^ ]

在示例中搜索adapter.NetworkInterfaceType



我希望它有帮助。
NetworkInterface.GetAllNetworkInterfaces() (using System.Net.NetworkInformation) should do the job:
https://msdn.microsoft.com/query/dev11.query?appId=Dev11IDEF1&l=DE-DE&k=k(NetworkInterface.GetAllNetworkInterfaces);k(TargetFrameworkMoniker-.NETFramework,Version%3Dv4.5);k(DevLang-csharp)&rd=true[^]

An example you can find here:
NetworkInterface-Klasse (System.Net.NetworkInformation)[^]
Search in the example for "adapter.NetworkInterfaceType"

I hope it helps.


这篇关于如何通过有线或无线方式检查连接是否正常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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