如何在 C# 中读取 SNMP MIB 文件?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/848132/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How can I read an SNMP MIB file in c#?
提问by
How to read a MIB file(.Mib file) using c#.net
如何使用 c#.net 读取 MIB 文件(.Mib 文件)
回答by Jon B
You can write your own ASN.1parser, or use an off-the-shelf component. I use NetToolWorks, and am happy with it.
您可以编写自己的ASN.1解析器,或使用现成的组件。我使用NetToolWorks,并且对它很满意。
If you do want to roll your own, here's some sample codeto get you started.
如果您确实想推出自己的产品,这里有一些示例代码可以帮助您入门。
回答by Lex Li
Based on what you need, you have multiple choices.
根据您的需要,您有多种选择。
ASN.1 parsers can be used to parse details. But if you just need to know the OID for objects, #SNMP Suite already has a basic MIB parser/compiler available via both its library (SharpSnmpLib.Mib namespace) and its GUI tool (MIB Compiler and Browser).
ASN.1 解析器可用于解析细节。但是,如果您只需要知道对象的 OID,#SNMP Suite 已经通过其库(SharpSnmpLib.Mib 命名空间)和 GUI 工具(MIB 编译器和浏览器)提供了一个基本的 MIB 解析器/编译器。
As far as I know, Net-SNMP only has a MIB to C tool.
据我所知,Net-SNMP 只有一个 MIB to C 工具。