資源簡介
最近接觸到相關項目,之前也沒有了解過snmp,實現了snmp的get和set,大家一起學習。

代碼片段和文件信息
using?System;
using?System.Collections.Generic;
using?System.ComponentModel;
using?System.Data;
using?System.Drawing;
using?System.Linq;
using?System.Text;
using?System.Windows.Forms;
namespace?snmpTest
{
????public?partial?class?Form1?:?Form
????{
????????public?Form1()
????????{
????????????InitializeComponent();
????????????this.label1.Text?=?““;
????????????this.label2.Text?=?““;
????????}
????????private?void?button1_Click(object?sender?EventArgs?e)
????????{
????????????string?hostIP;
????????????int?port?=?161;
????????????string?oid;
????????????Form3?form?=?new?Form3();
????????????form.ShowDialog();
????????????hostIP?=?form.Get();
????????????oid?=?form.Get1();
????????????Snmp?snmp?=?new?Snmp();
????????????string?get;
????????????get?=?snmp.getSnmp(oid?hostIP?port);
????????????this.label1.Text?=?“get到的值為:“?+?get;
????????}
????????private?void?button2_Click(object?sender?EventArgs?e)
????????{
????????????string?hostIP;
????????????int?port?=?161;
????????????string?oid;
????????????string?value;
????????????//.1.3.6.1.4.1.17409.1.3.1.1.0
????????????Form2?form2?=?new?Form2();
????????????form2.ShowDialog();
????????????hostIP?=?form2.Get();
????????????oid?=?form2.Get1();
????????????value?=?form2.Get2();
????????????Snmp?snmp?=?new?Snmp();
????????????snmp.setSnmp(oid?hostIP?port?value);
????????????this.label2.Text?=?“已將?“?+?oid?+?“的值修改為:“?+?value;
????????}
????}
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????3390??2016-11-22?15:03??snmpTest\snmpTest\1.ico
?????文件?????132096??2014-04-14?08:08??snmpTest\snmpTest\bin\Debug\SnmpSharpNet.dll
?????文件?????458240??2014-04-14?08:08??snmpTest\snmpTest\bin\Debug\SnmpSharpNet.pdb
?????文件?????402114??2014-04-14?08:08??snmpTest\snmpTest\bin\Debug\SnmpSharpNet.xm
?????文件??????17920??2016-11-22?15:03??snmpTest\snmpTest\bin\Debug\snmpTest.exe
?????文件??????34304??2016-11-22?15:03??snmpTest\snmpTest\bin\Debug\snmpTest.pdb
?????文件??????11600??2016-11-22?15:14??snmpTest\snmpTest\bin\Debug\snmpTest.vshost.exe
?????文件????????490??2015-11-13?10:24??snmpTest\snmpTest\bin\Debug\snmpTest.vshost.exe.manifest
?????文件???????1520??2016-11-22?09:58??snmpTest\snmpTest\Form1.cs
?????文件???????3961??2016-11-22?09:58??snmpTest\snmpTest\Form1.Designer.cs
?????文件???????5817??2016-11-22?09:58??snmpTest\snmpTest\Form1.resx
?????文件???????1422??2016-11-22?10:12??snmpTest\snmpTest\Form2.cs
?????文件???????5252??2016-11-22?10:11??snmpTest\snmpTest\Form2.Designer.cs
?????文件???????5817??2016-11-22?10:11??snmpTest\snmpTest\Form2.resx
?????文件???????1248??2016-11-22?10:14??snmpTest\snmpTest\Form3.cs
?????文件???????4186??2016-11-22?10:14??snmpTest\snmpTest\Form3.Designer.cs
?????文件???????5817??2016-11-22?10:14??snmpTest\snmpTest\Form3.resx
?????文件???????5359??2016-11-22?15:14??snmpTest\snmpTest\obj\x86\Debug\DesignTimeResolveAssemblyReferences.cache
?????文件???????6446??2016-11-22?15:21??snmpTest\snmpTest\obj\x86\Debug\DesignTimeResolveAssemblyReferencesInput.cache
?????文件???????1125??2016-11-22?15:14??snmpTest\snmpTest\obj\x86\Debug\snmpTest.csproj.FileListAbsolute.txt
?????文件???????1091??2016-11-22?15:03??snmpTest\snmpTest\obj\x86\Debug\snmpTest.csproj.GenerateResource.Cache
?????文件??????17920??2016-11-22?15:03??snmpTest\snmpTest\obj\x86\Debug\snmpTest.exe
?????文件????????180??2016-11-22?15:03??snmpTest\snmpTest\obj\x86\Debug\snmpTest.Form1.resources
?????文件????????180??2016-11-22?15:03??snmpTest\snmpTest\obj\x86\Debug\snmpTest.Form2.resources
?????文件????????180??2016-11-22?15:03??snmpTest\snmpTest\obj\x86\Debug\snmpTest.Form3.resources
?????文件??????34304??2016-11-22?15:03??snmpTest\snmpTest\obj\x86\Debug\snmpTest.pdb
?????文件????????180??2016-11-22?15:03??snmpTest\snmpTest\obj\x86\Debug\snmpTest.Properties.Resources.resources
?????文件???????2851??2016-11-22?09:47??snmpTest\snmpTest\Program.cs
?????文件???????1366??2016-11-22?09:21??snmpTest\snmpTest\Properties\AssemblyInfo.cs
?????文件???????2868??2016-11-22?09:21??snmpTest\snmpTest\Properties\Resources.Designer.cs
............此處省略20個文件信息
評論
共有 條評論