// TestSnmp.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。
//
#include <iostream>
#include <winsock2.h>
#include <snmp.h>
#include <mgmtapi.h>
#pragma comment(lib,"snmpapi.lib")
#pragma comment(lib,"mgmtapi.lib")
#define MAXNUMIP 10000
#define MAXNUMLIST 200
#define GET 0
#define GETNEXT 1
#define SET 2
#define WALK 3
#define INIFILENAME ".\\SNMPTools.ini"
#define SYSDESCR "1.3.6.1.2.1.1.1.0" //ObjectID for system descriptor
#define SYSOBJECTID "1.3.6.1.2.1.1.2.0" //ObjectID for system object ID
#define SYSCONTACT "1.3.6.1.2.1.1.4.0" //ObjectID for system contact
#pragma comment(lib, "ws2_32.lib")
int main(int argc, char *argv[])
{
std::cout << "Hello World!\n";
int operation = 0;
AsnObjectIdentifier reqObject;
RFC1157VarBindList variableBindings;
LPSNMP_MGR_SESSION session;
BYTE requestType;
win10+vs2017 snmp开发实例
最新推荐文章于 2021-07-11 17:22:17 发布