登录
首页 » Windows开发 » SNMP示例程序

SNMP示例程序

于 2022-03-15 发布 文件大小:5.49 kB
0 402
下载积分: 2 下载次数: 1

代码说明:

Net-snmp是一个开源代码,我所使用的版本为5.4.1,但是帮助文档不够详尽,相关资料甚少,希望这篇文章对刚接触这方面的人有所帮助,我也是刚接触net-snmp,有很多不懂的地方,希望有达人指点。 首先要编译整个工程,生成静态库文件,否则后面的工作不能进行。 打开net-snmp-5.4.1win32win32.dsw,我使用的环境为VS2003,需要对所有的项目进行转换。 打开snmptrap项目,观察其静态库引用路径可以发现它的路径配置为../lib/debug,这也正是生成项目后产生的lib文件的路径。自己项目的库文件引用配置路径可以参考snmptrap项目。 刚下载的程序包是不包含库文件的,需要自己生成。先后生成libagent、libhelpers、libnetsnmptrapd、libsnmp、netsnmpmibs五个项目,相应会生成五个静态库文件,包括:netsnmp.lib、netsnmpagent.lib、netsnmphelpers.lib、netsnmpmibs.lib和netsnmptrapd.lib。没有这些静态库文件就不能生成整个解决方案,这也正是直接生成解决方案不能成功的原因。好了,现在可以重新生成整个解决方案了。如果这步成功了那么就可以开始自己的工作了。 自己的项目的配置属性可以参考项目snmptrap或者项目snmptest来配置。下面这段代码是一段简单的测试程序,可以正常发送trap包到目标主机162端口,可以在此基础上根据自己的实际需要修改。 

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • 20多个常用代码
    20多个常用代码-more than 20 commonly used code
    2022-03-05 10:03:18下载
    积分:1
  • 使用代码生成条形码
    如果(string.IsNullOrWhiteSpace(this.BarCodeText))                 抛出新的ArgumentException(“条形码之前,必须设置为调用生成”);             //确保条码不包含无效字符                    }             //确定条码宽度             变种widthOfBarCodeString= 0;             VAR wideToNarrowRatio=2.0;             对于(VAR I =0; I
    2022-05-29 10:39:42下载
    积分:1
  • 用 C++ 创建简单的 Win32 服务程序(NTServCpl) 详细信息 < NT服务 > 《用 C++ 创建简单的 Win32 服务程序》一文...
    用 C++ 创建简单的 Win32 服务程序(NTServCpl) 详细信息 < NT服务 > 《用 C++ 创建简单的 Win32 服务程序》一文的例子代码。描述如何用 Visual C++ 创建 Windows NT 服务程序。创建该服务仅用到一个 C++ 类,这个类提供服务与操作系统之间一个简单的接口。使用这个类实现自己的服务非常简单,只要改写少数几个基类中的虚拟函数即可。文中有三个源代码参考例子:这是其中之一―― NTServCpl:是一个控制面版程序,用来控制 NTService 服务; 其余两个分别为: NTService:是一个简单的 Win32 服务,它就是用本文所描述的方法建立的; NTServCtrl:是一个独立的程序例子,用它可以监控某个 Win32 服务;-create simple Win32 services (NTServCpl) detailed information lt; NT services gt; "C create simple Win32 service procedures," a text of the code examples. Describe how to use Visual C create Windows NT service procedures. Creation of the service only to a category C, the category of services provided between an operating system with a simple interface. Use this category to realize their services are very simple, as long as rewriting a few of the base class function can be virtual. The text has three reference source code example : This is one of them-- NTServCpl : console is a procedure used to control NTService services; The remai
    2022-08-09 22:47:02下载
    积分:1
  • 路由器DV算法的模拟,功能齐全,可选择trace深度,VS9
    路由器DV算法的模拟,功能齐全,可选择trace深度,VS9开发-Router DV algorithm simulation, functional and choose trace depth, VS9 Development
    2023-07-04 20:00:04下载
    积分:1
  •  JAVA以其跨平台的特性深受人们喜爱,而又正由于它的跨平台的目的,使得它和本地机器的各种内部联系变得很少,约束了它的功能。解决JAVA对本地操作的一种方法就是...
     JAVA以其跨平台的特性深受人们喜爱,而又正由于它的跨平台的目的,使得它和本地机器的各种内部联系变得很少,约束了它的功能。解决JAVA对本地操作的一种方法就是JNI。   JAVA通过JNI调用本地方法,而本地方法是以库文件的形式存放的(在WINDOWS平台上是DLL文件形式,在UNIX机器上是SO文件形式)。通过调用本地的库文件的内部方法,使JAVA可以实现和本地机器的紧密联系,调用系统级的各接口方法。 -JAVA characteristics of its cross-platform very popular, and because it is the purpose of cross-platform, making it the local machine to become small internal contact, the functions of its binding. JAVA solution on the local operation is a method of JNI. JAVA through JNI to call native methods, and the local method is based on the form of library files stored (in the WINDOWS platform are on the form of DLL files, in the UNIX machines are SO on the form of a document). By calling the local library file internal methods, so that JAVA and local machine can achieve close contact, call the system-level methods of the interface.
    2022-08-19 07:40:31下载
    积分:1
  • 一些常用的键盘扫描去抖程序,都是语言编写程序。
    一些常用的键盘扫描去抖程序,都是语言编写程序。-Some commonly used keyboard scan debounced procedures are programming languages.
    2022-05-10 11:22:45下载
    积分:1
  • Used at the same time the ranks of the total statistics of their own self
    用于同时进行行列合计统计自学编的自用小程序-Used at the same time the ranks of the total statistics of their own self-made applet
    2022-02-07 04:45:10下载
    积分:1
  • C++显示天气预报
    此代码是用c++编写的简单明了的显示天气预报的小程序,希望能给大家带来帮助,大家耐心研究即可,好好努力啊,加油
    2022-03-04 06:30:17下载
    积分:1
  • 一个趣味的看图软件
    一个趣味的看图软件-an interesting flashcards software
    2022-07-16 09:55:36下载
    积分:1
  • Windows ce operating system for memory management used in memory allocation, rec...
    对windows ce操作系统的存储管理采用的内存分配,回收,虚拟内存映像,调页等机制作深入的探讨-Windows ce operating system for memory management used in memory allocation, recovery, virtual memory mapping, paging and other mechanisms to explore deeper into the
    2022-08-16 02:34:27下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载