当前位置:网站首页>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>
边栏推荐
- 根据excel生成create建表SQL语句
- Shell--第一天作业
- Standard C language learning summary 3
- RAID磁盘阵列
- Servlet
- Shell script -- program conditional statements (conditional tests, if statements, case branch statements, echo usage, for loops, while loops)
- DOM - Events
- RAID disk array
- Layer 3 switching and VRRP
- JS string method Encyclopedia
猜你喜欢

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

起点中文网 字体反爬技术 网页可以显示数字字母 网页代码是乱码或空格

Neo4j运行报错Error occurred during initialization of VM Incompatible minimum and maximum heap sizes spec

RAID disk array

静态和浮动路由

The.Joernindex database has no content after Joern runs

远程访问云服务器上Neo4j等服务的本地网址

A timed task reminder tool

easypoi导出表格带echars图表

Icc2 analysis timing artifact analyze_ design_ violations
随机推荐
Standard C language summary 4
MOOC Weng Kai C language week 6: arrays and functions: 1. Arrays 2. Definition and use of functions 3. Parameters and variables of functions 4. Two dimensional arrays
easypoi导出表格带echars图表
ES6 add -- > object
分解路径为目录名和文件名的方法
DHCP服务
Custom component -- communication between parent and child components
Esxi community network card driver
[learning notes] tool
Results fill in the blank. How many days of national day are Sundays (solved by pure Excel)
[learning notes] drive
VLAN configuration
MOOC翁恺C语言 第四周:进一步的判断与循环:3.多路分支4.循环的例子5.判断和循环常见的错误
登录进oracle10g的oem,想管理监听程序却总是弹出帐号密码输入页面
Easypoi one to many, merge cells, and adapt the row height according to the content
MySQL excludes holidays and calculates the date difference
Freemaker merges cells, uses if and else tags, and processes null and empty strings
codesensor:将代码转化为ast后再转化为文本向量
Group management and permission management
Codesensor: convert the code into AST and then into text vector