在C#中列出同一网络中的计算机 [英] List the computers in the same network in C#

查看:91
本文介绍了在C#中列出同一网络中的计算机的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在做与SNMP相关的最后一年项目。我需要在C#中找到IP自动检测的解决方案。当我运行主项目时,程序可以自动检测代理的IP并检索它的MIB,这样用户就不需要输入代理的IP地址。除此之外,我还寻找可以检测C#编码中已打开或关闭的节点的解决方案。希望可以为这两个问题找到解决方案。谢谢。

I''m doing the final year project that related to the SNMP. I need to find the solution for the IP auto detection in C#. When I run the main project, the program can automatically detect the IP for the agent and retrieve it''s MIB, so that the user do not need to enter the IP address of the agent. Beside that, I also look for the solution that can detect the nodes that had switch on or switch off in C# coding. Wish can get the solution for these two problems. Thank you.

推荐答案

什么?

获取当前计算机的IP地址非常简单。有一个System.Net.NetworkInformation.NetworkInterface类可以为你处理。

注意:它不一定会给你外部。 IP取决于你的网络配置。


那你之后有什么实际的呢?
What?
Getting the IP address of the current computer is pretty simple. There is like a System.Net.NetworkInformation.NetworkInterface class that handles that for you.
Note: It does not necessarily give you the "outside" IP depending on your network configuration.

So what are you ACTUALLY after?



什么?

获取当前计算机的IP地址非常简单。有一个System.Net.NetworkInformation.NetworkInterface类可以为你处理。

注意:它不一定会给你外部。 IP取决于您的网络配置。


那么你之后的实际操作是什么?
What?
Getting the IP address of the current computer is pretty simple. There is like a System.Net.NetworkInformation.NetworkInterface class that handles that for you.
Note: It does not necessarily give you the "outside" IP depending on your network configuration.

So what are you ACTUALLY after?



我知道要获取本地IP(127.0.0.1),但我的意思是那些连接到我的经理的节点的IP,我需要检索他们的MIB而不输入他们的IP。我不知道它在C#中的编码。


这是我编码中用来打开经理和代理之间连接的部分:

I know to get the local IP (127.0.0.1), but what I means here is that the IP for the nodes those connect to my manager, I need to retrieve their MIB without enter their IP. I do not know the coding for it in the C#.

This is the part of my coding that use to open the connection between manager and the agent:

<跨度类= codeLink 的onclick = 模糊(此,this.parentNode.parentNode,的getChildren(本),TRUE);>展开< /跨度> <跨度类= codeDivider> | <跨度类= codeLink 的onclick = 全选(本);>选择 <跨度类= codeDivider> | <跨度类= codeLink 的onclick = 自动换行(在此);>裹 <跨度类= codeDivider> | <跨度类= codeLink 的onclick =LineNumbers(本) ;>行号


什么? 节点是什么意思?和MIB。 ?这对贵公司来说是否属于某种程度?
What? What do you mean by "nodes" and "MIB" ? Is that something propriatary to your company?


这篇关于在C#中列出同一网络中的计算机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆