本人是delphi初学者,但现在不得不编写这个程序,又找不到这方面的资料,高手们能指点一下吗

解决方案 »

  1.   

    //// Under Function Can't Import becouse the DLL File Unknwonfunction SnmpExtensionQueryEx(nRequestType: UINT; nTransactionId: UINT;  pVarBindList: TSnmpVarBindList; pContextInfo: TAsnOctetString; pErrorStatus:  TAsnInteger32; pErrorIndex: TAsnInteger32): boolean; stdcall; external Inetmib1name 'SnmpExtensionQueryEx';}
    function SnmpExtensionTrap(pEnterpriseOid: TAsnObjectIdentifier; pGenericTrapId:  TAsnInteger32; pSpecificTrapId: TAsnInteger32; pTimeStamp: TAsnTimeticks;  pVarBindList: TSnmpVarBindList): boolean; stdcall; external Inetmib1 name'SnmpExtensionTrap';
    procedure SnmpExtensionClose; stdcall; external Igmpagnt name 'SnmpExtensionClose';
    /////////////////////////////////////////////////////////////////////////////////                                                                           //// SNMP Extension API Type Definitions                                       ////                                                                           /////////////////////////////////////////////////////////////////////////////////
    type  PFNSNMPEXTENSIONINIT = function(dwUpTimeReference: DWORD; phSubagentTrapEvent:    THANDLE; pFirstSupportedRegion: TAsnObjectIdentifier): boolean; stdcall;
      PFNSNMPEXTENSIONINITEX = function(pNextSupportedRegion: TAsnObjectIdentifier):    boolean; stdcall;
      PFNSNMPEXTENSIONQUERY = function(bPduType: BYTE; pVarBindList: TSnmpVarBindList;    pErrorStatus: TAsnInteger32; pErrorIndex: TAsnInteger32): boolean; stdcall;
      PFNSNMPEXTENSIONQUERYEX = function(nRequestType: UINT; nTransactionId: UINT;    pVarBindList: TSnmpVarBindList; pContextInfo: TAsnOctetString; pErrorStatus:    TAsnInteger32; pErrorIndex: TAsnInteger32): boolean; stdcall;
      PFNSNMPEXTENSIONTRAP = function(pEnterpriseOid: TAsnObjectIdentifier;    pGenericTrapId: TAsnInteger32; pSpecificTrapId: TAsnInteger32; pTimeStamp:    TAsnTimeticks; pVarBindList: TSnmpVarBindList): boolean; stdcall;
      PFNSNMPEXTENSIONCLOSE = procedure; stdcall;
    /////////////////////////////////////////////////////////////////////////////////                                                                           //// SNMP API Prototypes                                                       ////                                                                           /////////////////////////////////////////////////////////////////////////////////
    function SnmpUtilOidCpy(pOidDst: TAsnObjectIdentifier; pOidSrc: TAsnObjectIdentifier):  SNMPAPI; stdcall external snmpapidll name 'SnmpUtilOidCpy';
    function SnmpUtilOidAppend(pOidDst: TAsnObjectIdentifier; pOidSrc:  TAsnObjectIdentifier): SNMPAPI; stdcall; external snmpapidll name'SnmpUtilOidAppend';
    function SnmpUtilOidNCmp(pOid1: TAsnObjectIdentifier; pOid2: TAsnObjectIdentifier;  nSubIds: UINT): SNMPAPI; stdcall; external snmpapidll name 'SnmpUtilOidNCmp';
    function SnmpUtilOidCmp(pOid1: TAsnObjectIdentifier; pOid2: TAsnObjectIdentifier):  SNMPAPI; stdcall; external snmpapidll name 'SnmpUtilOidCmp';
    procedure SnmpUtilOidFree(pOid: TAsnObjectIdentifier); stdcall; external snmpapidllname 'SnmpUtilOidFree';
    function SnmpUtilOctetsCmp(pOctets1: TAsnOctetString; pOctets2: TAsnOctetString):  SNMPAPI; stdcall; external snmpapidll name 'SnmpUtilOctetsCmp';
    function SnmpUtilOctetsNCmp(pOctets1: TAsnOctetString; pOctets2: TAsnOctetString;  nChars: UINT): SNMPAPI; stdcall; external snmpapidll name 'SnmpUtilOctetsNCmp';
    function SnmpUtilOctetsCpy(pOctetsDst: TAsnOctetString; pOctetsSrc: TAsnOctetString):  SNMPAPI; stdcall; external snmpapidll name 'SnmpUtilOctetsCpy';
    procedure SnmpUtilOctetsFree(pOctets: TAsnOctetString); stdcall; external snmpapidllname 'SnmpUtilOctetsFree';
    function SnmpUtilAsnAnyCpy(pAnyDst: TAsnAny; pAnySrc: TAsnAny): SNMPAPI; stdcall;external snmpapidll name 'SnmpUtilAsnAnyCpy';
    procedure SnmpUtilAsnAnyFree(pAny: TAsnAny); stdcall; external snmpapidll name'SnmpUtilAsnAnyFree';
    function SnmpUtilVarBindCpy(pVbDst: TSnmpVarBind; pVbSrc: TSnmpVarBind): SNMPAPI;stdcall; external snmpapidll name 'SnmpUtilVarBindCpy';
      

  2.   

    procedure SnmpUtilVarBindFree(pVb: TSnmpVarBind); stdcall; external snmpapidll name'SnmpUtilVarBindFree';
    function SnmpUtilVarBindListCpy(pVblDst: TSnmpVarBindList; pVblSrc: TSnmpVarBindList):  SNMPAPI; stdcall; external snmpapidll name 'SnmpUtilVarBindListCpy';
    procedure SnmpUtilVarBindListFree(pVbl: TSnmpVarBindList); stdcall; external snmpapidllname 'SnmpUtilVarBindListFree';
    procedure SnmpUtilMemFree(pMem: pointer); stdcall; external snmpapidll name'SnmpUtilMemFree';
    function SnmpUtilMemAlloc(nBytes: UINT): pointer; stdcall; external snmpapidll name'SnmpUtilMemAlloc';
    function SnmpUtilMemReAlloc(pMem: pointer; nBytes: UINT): pointer; stdcall; externalsnmpapidll name 'SnmpUtilMemReAlloc';
    function SnmpUtilOidToA(Oid: TAsnObjectIdentifier): pchar; stdcall; external snmpapidllname 'SnmpUtilOidToA';
    function SnmpUtilIdsToA(Ids: UINT; IdLength: UINT): pchar; stdcall; external snmpapidllname 'SnmpUtilIdsToA';
    procedure SnmpUtilPrintOid(Oid: TAsnObjectIdentifier); stdcall; external snmpapidllname 'SnmpUtilPrintOid';
    procedure SnmpUtilPrintAsnAny(pAny: TAsnAny); stdcall; external snmpapidll name'SnmpUtilPrintAsnAny';
    function SnmpSvcGetUptime: DWORD; stdcall; external snmpapidll name'SnmpSvcGetUptime';
    procedure SnmpSvcSetLogLevel(nLogLevel: integer); stdcall; external snmpapidll name'SnmpSvcSetLogLevel';
    procedure SnmpSvcSetLogType(nLogType: integer); stdcall; external snmpapidll name'SnmpSvcSetLogType';
    /////////////////////////////////////////////////////////////////////////////////                                                                           //// SNMP Debugging Definitions                                                ////                                                                           /////////////////////////////////////////////////////////////////////////////////const  SNMP_LOG_SILENT   = $0;  SNMP_LOG_FATAL    = $1;  SNMP_LOG_ERROR    = $2;  SNMP_LOG_WARNING  = $3;  SNMP_LOG_TRACE    = $4;  SNMP_LOG_VERBOSE  = $5;
      SNMP_OUTPUT_TO_CONSOLE = $1;  SNMP_OUTPUT_TO_LOGFILE = $2;  SNMP_OUTPUT_TO_EVENTLOG = $4; // no longer supported  SNMP_OUTPUT_TO_DEBUGGER = $8;
    /////////////////////////////////////////////////////////////////////////////////                                                                           //// SNMP Debugging Prototypes                                                 ////                                                                           /////////////////////////////////////////////////////////////////////////////////
    procedure SnmpUtilDbgPrint(nLogLevel: integer; // see log levels above...  szFormat: pchar); stdcall; external snmpapidll name 'SnmpUtilDbgPrint';
    {$IFDEF DBG}{$DEFINE SNMPDBG(_x_)SnmpUtilDbgPrint _x_}{$ELSE}{$DEFINE SNMPDBG(_x_)}{$ENDIF}
    /////////////////////////////////////////////////////////////////////////////////                                                                           //// Miscellaneous definitions                                                 ////                                                                           /////////////////////////////////////////////////////////////////////////////////const// DEFINE_SIZEOF=(array)(sizeof(array) / sizeof((array)[0]))//   DEFINE_OID(SubIdArray) {DEFINE_SIZEOF(SubIdArray),(SubIdArray)}//   DEFINE_NULLOID() {0,NULL}//   DEFINE_NULLOCTETS() {NULL,0,FALSE}
      DEFAULT_SNMP_PORT_UDP = 161;  DEFAULT_SNMP_PORT_IPX = 36879;  DEFAULT_SNMPTRAP_PORT_UDP = 162;  DEFAULT_SNMPTRAP_PORT_IPX = 36880;
      SNMP_MAX_OID_LEN  = 128;
    /////////////////////////////////////////////////////////////////////////////////                                                                           //// API Error Code Definitions                                                ////                                                                           /////////////////////////////////////////////////////////////////////////////////
      SNMP_MEM_ALLOC_ERROR = 1;  SNMP_BERAPI_INVALID_LENGTH = 10;  SNMP_BERAPI_INVALID_TAG = 11;  SNMP_BERAPI_OVERFLOW = 12;  SNMP_BERAPI_SHORT_BUFFER = 13;  SNMP_BERAPI_INVALID_OBJELEM = 14;  SNMP_PDUAPI_UNRECOGNIZED_PDU = 20;  SNMP_PDUAPI_INVALID_ES = 21;  SNMP_PDUAPI_INVALID_GT = 22;  SNMP_AUTHAPI_INVALID_VERSION = 30;  SNMP_AUTHAPI_INVALID_MSG_TYPE = 31;  SNMP_AUTHAPI_TRIV_AUTH_FAILED = 32;
    /////////////////////////////////////////////////////////////////////////////////                                                                           //// Support for old definitions (support disabled via SNMPSTRICT)             ////                                                                           /////////////////////////////////////////////////////////////////////////////////
    {$IFNDEF SNMPSTRICT}
    const  ASN_RFC1155_IPADDRESS = ASN_IPADDRESS;  ASN_RFC1155_COUNTER = ASN_COUNTER32;  ASN_RFC1155_GAUGE = ASN_GAUGE32;  ASN_RFC1155_TIMETICKS = ASN_TIMETICKS;  ASN_RFC1155_OPAQUE = ASN_OPAQUE;  ASN_RFC1213_DISPSTRING = ASN_OCTETSTRING;
      ASN_RFC1157_GETREQUEST = SNMP_PDU_GET;  ASN_RFC1157_GETNEXTREQUEST = SNMP_PDU_GETNEXT;  ASN_RFC1157_GETRESPONSE = SNMP_PDU_RESPONSE;  ASN_RFC1157_SETREQUEST = SNMP_PDU_SET;  ASN_RFC1157_TRAP  = SNMP_PDU_V1TRAP;
      ASN_CONTEXTSPECIFIC = ASN_CONTEXT;  ASN_PRIMATIVE     = ASN_PRIMITIVE;
    type  RFC1157VarBindList = TSnmpVarBindList;  RFC1157VarBind = TSnmpVarBind;  AsnInteger = TAsnInteger32;  AsnCounter = TAsnCounter32;  AsnGauge = TAsnGauge32;
    {$ENDIF} // SNMPSTRICT
    implementation
    end.
      

  3.   

    贴错了。开始部分没有贴出来。我打个包给你下载吧.
    http://www.ksaiy.com/snmt.txt不好意思啊.你去上面的那个地址看吧.