W
wrnxd168
Unregistered / Unconfirmed
GUEST, unregistred user!
开发过SNMP的朋友请献上你们的代码,让这里成为SNMP的资料宝地
使用indy snmp 组件实现get getnext
function TForm1.GetRequest(oid:string): boolean;
begin
with idsnmp1do
begin
Community := edtCommStr.text;
Host := edtHost.Text;
active:=True;
Query.Clear;
Query.PDUType:=PDUGetRequest;
Query.MIBAdd(oid,'');
{Do not Localize}
result:= SendQuery;
active:=False;
end;
function TForm1.GetNextRequest(oid:string): boolean;
begin
with idsnmp1do
begin
Community := edtCommStr.text;
Host := edtHost.Text;
active:=True;
Query.Clear;
Query.PDUType:=PDUGetNextRequest;
Query.MIBAdd(oid,'');
{Do not Localize}
result:= SendQuery;
active:=False;
end;
end;
使用indy snmp 组件实现get getnext
function TForm1.GetRequest(oid:string): boolean;
begin
with idsnmp1do
begin
Community := edtCommStr.text;
Host := edtHost.Text;
active:=True;
Query.Clear;
Query.PDUType:=PDUGetRequest;
Query.MIBAdd(oid,'');
{Do not Localize}
result:= SendQuery;
active:=False;
end;
function TForm1.GetNextRequest(oid:string): boolean;
begin
with idsnmp1do
begin
Community := edtCommStr.text;
Host := edtHost.Text;
active:=True;
Query.Clear;
Query.PDUType:=PDUGetNextRequest;
Query.MIBAdd(oid,'');
{Do not Localize}
result:= SendQuery;
active:=False;
end;
end;