当前位置:网站首页>Read the IP and device information of the switch node in the XML file, Ping the device, and the exception is displayed in the list
Read the IP and device information of the switch node in the XML file, Ping the device, and the exception is displayed in the list
2022-07-28 07:10:00 【angleoldhen】
{
treeView1.Nodes.Clear();
Ping pingSender = new Ping();
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.Load("ip.xml");
XmlNodeList xnList = xmlDoc.SelectNodes("//switch");
foreach (XmlNode xn in xnList)
{
string switch_ip = (xn.SelectSingleNode("ip")).InnerText;
string switch_info = xn.SelectSingleNode("info").InnerText;
PingReply reply = pingSender.Send(switch_ip, 120);// The first parameter is zero ip Address , The second parameter is ping Time for
if (reply.Status != IPStatus.Success)
{
treeView1.Nodes.Add(switch_ip + " ( " + switch_info + ")");
}
}
}
xml The content of the document looks like :
<?xml version="1.0" encoding="GB2312" standalone="yes" ?>
<company>
<switch>
<ip>192.168.10.1</ip>
<info>H3C 5500 Switch </info>
</switch>
<switch>
<ip>192.168.10.2</ip>
<info>H3C-S3100 Switch </info>
</switch>
</company>
边栏推荐
- 读取xml文件里switch节点的IP和设备信息,ping设备,异常显示在列表里
- Gobang optimized version
- Standard C language summary 4
- MOOC Weng Kai C language week 7: array operation: 1. array operation 2. Search 3. preliminary sorting
- [learning notes] thread creation
- Neo4j运行报错Error occurred during initialization of VM Incompatible minimum and maximum heap sizes spec
- NAT-网络地址转换
- Results fill in the blank shopping list (teach you to solve it with Excel)
- 分解路径为目录名和文件名的方法
- Raspberry pie serial port
猜你喜欢

Shell--第一天作业

The.Joernindex database has no content after Joern runs

PXE unattended installation management

Custom components -- slots

MySQL build database Series (I) -- download MySQL

静态和浮动路由

Custom components -- styles

Codesensor: convert the code into AST and then into text vector

MySQL查询父节点下面的所有子孙节点,查询用户列表时多级(公司)部门处理,根据反射,递归树形结构工具类

Custom component -- data listener
随机推荐
MOOC Weng Kai C language week 5: 1. cycle control 2. multiple cycles 3. cycle application
Erudite Valley Learning Records] Super summary, attentive sharing | common APIs
Icc2 analysis timing artifact analyze_ design_ violations
根据excel生成create建表SQL语句
Shell--第一天作业
Implementation method of Bert
Event_ Loop event loop mechanism
Forward and backward slash notes
在转化词向量之前先转化为AST再转化为词向量的实现方法
360 compatibility issues
Result fill in the blank (dfs*c language)
Implementation method of converting ast into word vector before converting word vector
MOOC翁恺C语言 第六周:数组与函数:1.数组2.函数的定义与使用3.函数的参数和变量4.二维数组
Results fill in the blanks for beer and drinks
DHCP服务
起点中文网 字体反爬技术 网页可以显示数字字母 网页代码是乱码或空格
Multiprocessing (multiprocessing)
Standard C language learning summary 7
bond模式配置
读取xml文件里switch节点的IP和设备信息,ping设备,异常显示在列表里