当前位置:网站首页>C# 35. Select default network card
C# 35. Select default network card
2022-06-12 11:25:00 【lljss2020】
Undertaking 《C# 32. Select a network card from the static class implementation drop-down box 》, Open the application to automatically select the available wired network card .
1. Code
private void GetDefaultIf()
{
NetIf.NetIfList.Clear();
NetIf.NetIfList = NetIf.GetNetIf();
List<NetIf.NetIfType> listbak = new List<NetIf.NetIfType>(NetIf.NetIfList);
comboBoxNetIf.Items.Clear();
int cnt = 0;
NetIf.NetIfList.Clear();
foreach (NetIf.NetIfType m in listbak)
{
if ((m.netIf.IndexOf("Virtual") == -1) && (m.netIf.IndexOf("Bluetooth") == -1))
{
comboBoxNetIf.Items.Add(m.netIf);
NetIf.NetIfList.Add(listbak[listbak.IndexOf(m)]);
cnt++;
}
}
if(cnt == 1)
{
comboBoxNetIf.SelectedIndex = 0;
}
}
public Form1()
{
.......
GetDefaultIf();
}
2. effect :

边栏推荐
猜你喜欢

redis 总结

Pytoch notes

InfoQ geek media's 15th anniversary solicitation |position:fixed virtual button cannot take effect after being triggered. Problem analysis and Solution Exploration

SOT23(Small Outline Transistor)

AcWing 128. Editor (to effectively modify the specified position in the top stack)

890. find and replace mode
![[Blue Bridge Cup SCM 11th National race]](/img/da/3c8a9efd5b28f67816f239531a0339.png)
[Blue Bridge Cup SCM 11th National race]

网络的拓扑结构

Problems in cross validation code of 10% discount

卡鱼刺别再喝醋吞米饭了!教你2招,让鱼刺安全“跑出来”
随机推荐
2022-06-11: note that in this document, graph is not the meaning of adjacency matrix, but a bipartite graph. In the adjacency matrix with length N, there are n points, matrix[i][j]
AcWing 132. 小组队列(队列模拟题)
DS18B20数字温度计 (一) 电气特性, 寄生供电模式和远距离接线
AcWing 135. Maximum subsequence sum (prefix sum + monotone queue to find the minimum value of fixed length interval)
AcWing 128. Editor (to effectively modify the specified position in the top stack)
AcWing 132. Group queue (queue simulation question)
套接字编程TCP篇
InfoQ geek media's 15th anniversary solicitation |position:fixed virtual button cannot take effect after being triggered. Problem analysis and Solution Exploration
多普勒效应的基本原理
selenium使用代理IP
字节序(网络/主机)转换
logrotate日志轮转方式create和copytruncate原理
Golang基础(6)
Socket Programming TCP
Sendmail Dovecot 邮件服务器
Golang Foundation (7)
Flex layout
读mysql45讲-自我总结(部分)
Thinking about the cooperation process of Network Library -- Some Thoughts on reading brpc
NLP data set download address for naturallanguageprocessing