Stack Overflow Asked by Biurokles on December 25, 2021
I’m creating small app for private use. User will type an IP address in a TextBox and test whether it pings correctly.
It doesn’t work because the TextBox is a WinForms Control which can’t be converted into bytes.
Is there any way to set top-down type of data in this TexBox?
System.Text.Encoding.Default.GetBytes(ip_textbox.Text);
OctetString community = new OctetString("public");
AgentParameters param = new AgentParameters(community);
param.Version = SnmpVersion.Ver1;
IpAddress agent = new IpAddress(ip_textbox.Text);
UdpTarget target = new UdpTarget((IPAddress)agent, 161, 2000, 1);
Pdu pdu = new Pdu(PduType.Get);
pdu.VbList.Add(".1.3.6.1.4.1.2.1.1.2.0");
SnmpV1Packet result = (SnmpV1Packet)target.Request(pdu, param);
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP