c#中的网络图 [英] Network Diagram in c#

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

问题描述

我希望根据我的数据库中存储的信息生成网络图

IP ADRESS STATUS

128.98.76.6有效

128.96 .35.21有效

128.5.68.9未激活


我想生成一个网络图,其中Active节点由绿色链接显示且未激活红色链接。

我应该如何在C#中执行此操作

I want ot generate a Network Diagram based on the information Stored in my Database
IP ADRESS STATUS
128.98.76.6 Active
128.96.35.21 Active
128.5.68.9 Not Active

I want to generate a network diagram in which the Active nodes are shown by a green link and non active in Red link.
How should i do this in C#

推荐答案

到目前为止您编写/尝试了什么?如果你对目前所做的事情没有更好的了解,那么有人可能在这里提出的任何建议都可能无法对应甚至兼容
What have you coded/tried so far? Without a better idea of what you have done so far, any suggestions someone might have here may in no way correspond or even be compatible


你好


我建议你首先创建一个对象设计,它将你从数据库中检索的数据存储在内存中。


你将在运行时向表单添加控件。你将不得不决定一个通用的算法,它将决定如何在窗体上安排控件。


接下来查看.NET的绘图类,这些将使你能够绘制很多表格上的任何内容。 MSDN

如果您的网络非常大,请考虑如何设计您的对象,以便可以单独查看网络的不同区域。


如果您想要真实根据您还需要查看网络通信的网络状态更新UI的时间,NetworkInformation命名空间将有助于此 MSDN


另外,对于实时更新,请查看线程 MSDN


如果您不熟悉任何所需组件,请阅读MSDN条目,并创建一个明确目标的设计。


即使您尝试创建应用程序F ail,这是最好的学习方式,然后发布您可能遇到的任何问题/问题,我们将看看如何帮助您。
Hi

Well I suggest you start by creating an object design which will store the data you retrieve from the database in memory.

You will be adding controls to a form at runtime. You will have to decide on a general algorithm which will dictate how controls are arranged on the form.

Next looking into the drawing classes of .NET, these will enable you to draw pretty much anything on a form. MSDN

If your network is very large think about how you may design your objects in such a way that different regions of the network may be viewed individually.

If you want real time updates of your UI based on the state of the network you will also need to look at network communications, the NetworkInformation namespace will help with this MSDN

Also for real time updates look into threading MSDN

Read the MSDN entries if you are unfamiliar with any of the required components and create a design with clear goals of what you want to achieve.

Try to create the app even if you fail, its the best way to learn, then post any problems/questions you may encounter and we''ll have a look at how to help you out.


您好......

我正在Windows中使用现成的进程... system32文件夹,如ping.exe,...等。

我正在使用Sytem.Diagnostics库执行该进程...

现在我要做的就是存储消息框中显示的一些数据,例如


ping的输出是


C:\> ping 172.16.73.4


使用32字节数据Ping 172.16.73.4:


来自172.16.73.4的回复:bytes = 32 time = 16ms TTL = 127

来自172.16.73.4的回复:bytes = 32 time = 21ms TTL = 127

来自172.16.73.4的回复:bytes = 32 time = 19ms TTL = 127

来自172.16.73.4的回复:bytes = 32 time = 26ms TTL = 127


Ping统计数据为172.16.73.4:

数据包:已发送= 4,已接收= 4,已丢失= 0(0%丢失),

近似值以毫秒计的往返时间:

最小值= 16毫秒,最大值= 26毫秒,平均值= 20毫秒


看看这个迷失是0%...

现在必须要做的是我必须将丢失的%与IP地址一起保存并以网络图的形式显示输出,即显示服务器和ping节点....
Hello...
I am taking the readymade processes in Windows...system32 folder like ping.exe,...etc.
I am executing the process using Sytem.Diagnostics library...
Now what i have to do is store the some data that is displayed in the message box like


the output of ping is

C:\>ping 172.16.73.4

Pinging 172.16.73.4 with 32 bytes of data:

Reply from 172.16.73.4: bytes=32 time=16ms TTL=127
Reply from 172.16.73.4: bytes=32 time=21ms TTL=127
Reply from 172.16.73.4: bytes=32 time=19ms TTL=127
Reply from 172.16.73.4: bytes=32 time=26ms TTL=127

Ping statistics for 172.16.73.4:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 16ms, Maximum = 26ms, Average = 20ms


take a look at this the Lost is 0%...
Now what has to be done is that I have to save the Lost % along with the IP ADDRESS and display the output in the form of Network Diagram i.e display a server and the pinged nodes....


这篇关于c#中的网络图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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