资源简介
c#实现拓扑关系图,有详细的文档说明和源代码
代码片段和文件信息
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using System.IO;
namespace Graphic
{
class CommFnc
{
public static string FindFileToOpen()
{
string RetVal FileName;
RetVal = ““;
OpenFileDialog OpenDir = new OpenFileDialog();
OpenDir.InitialDirectory = “c:\\“;
OpenDir.Filter = “Text Files|*.txt“;
OpenDir.title = “Select a data file.“;
if (OpenDir.ShowDialog() == DialogResult.OK)
{
FileName = OpenDir.FileName;
if (FileName != null)
{
RetVal = FileName;
}
}
return RetVal;
}
public static string AssignFileToSave()
{
string RetVal FileName;
RetVal = ““;
SaveFileDialog SaveDir = new SaveFileDialog();
SaveDir.InitialDirectory = “c:\\“;
SaveDir.Filter = “Text Files|*.txt“;
SaveDir.title = “Write a data file to disk.“;
if (SaveDir.ShowDialog() == DialogResult.OK)
{
FileName = SaveDir.FileName;
if (FileName != null)
{
RetVal = FileName;
}
}
return RetVal;
}
public static void RowDecode(string pLine ref string pVariable ref string pValue)
{
int PosSep = 0;
int PosEnd = pLine.Length;
int nCar = 0;
if (pLine == ““)
{
pVariable = “null“;
pValue = “null“; ;
}
else
{
PosSep = pLine.IndexOf(“=“);
pVariable = pLine.Substring(0 PosSep);
PosEnd = pLine.LastIndexOf(“;“);
nCar = PosEnd - PosSep - 1;
pValue = pLine.Substring(PosSep + 1 nCar);
}
}
public static double module(int x int y)
{
return System.Math.Sqrt(x*x + y*y);
}
public static double distance(int x1 int y1 int x2 int y2)
{
return module((x1 - x2)(y1 - y2));
}
}
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 2355 2008-01-25 12:28 C# Graphic\Graphic\Graphic\Common.cs
文件 1676 2008-01-25 12:08 C# Graphic\Graphic\Graphic\FrmManageob
文件 4865 2008-01-25 12:08 C# Graphic\Graphic\Graphic\FrmManageob
文件 5814 2008-01-25 12:08 C# Graphic\Graphic\Graphic\FrmManageob
文件 12387 2008-01-25 13:36 C# Graphic\Graphic\Graphic\FrmSchema.cs
文件 11723 2008-01-24 12:51 C# Graphic\Graphic\Graphic\FrmSchema.Designer.cs
文件 158278 2008-01-23 12:49 C# Graphic\Graphic\Graphic\FrmSchema.resx
文件 3707 2008-01-24 12:53 C# Graphic\Graphic\Graphic\Graphic.csproj
文件 14765 2008-01-25 16:30 C# Graphic\Graphic\Graphic\GScenario.cs
文件 97254 2008-01-22 15:31 C# Graphic\Graphic\Graphic\Network.bmp
文件 763 2008-01-25 16:35 C# Graphic\Graphic\Graphic\net_sample.txt
文件 478 2008-01-24 12:51 C# Graphic\Graphic\Graphic\Program.cs
文件 1262 2008-01-21 15:26 C# Graphic\Graphic\Graphic\Properties\AssemblyInfo.cs
文件 2842 2008-01-21 15:26 C# Graphic\Graphic\Graphic\Properties\Resources.Designer.cs
文件 5612 2008-01-21 15:26 C# Graphic\Graphic\Graphic\Properties\Resources.resx
文件 1091 2008-01-21 15:26 C# Graphic\Graphic\Graphic\Properties\Settings.Designer.cs
文件 249 2008-01-21 15:26 C# Graphic\Graphic\Graphic\Properties\Settings.settings
文件 37482 2008-01-15 12:13 C# Graphic\Graphic\Graphic\Receiver.png
文件 96714 2008-01-22 15:43 C# Graphic\Graphic\Graphic\Router.bmp
文件 38508 2008-01-15 12:13 C# Graphic\Graphic\Graphic\Sender.png
文件 914 2008-01-21 15:29 C# Graphic\Graphic\Graphic.sln
文件 320197 2008-01-25 16:57 C# Graphic\Graphic Setup.exe
目录 0 2008-01-25 17:00 C# Graphic\Graphic\Graphic\bin
目录 0 2008-01-25 16:59 C# Graphic\Graphic\Graphic\Properties
目录 0 2008-01-25 16:59 C# Graphic\Graphic\Graphic
目录 0 2008-01-25 16:59 C# Graphic\Graphic
目录 0 2014-01-22 19:09 C# Graphic
----------- --------- ---------- ----- ----
818936 27
............此处省略0个文件信息
- 上一篇:深入.net平台和C#编程课后练习答案
- 下一篇:用VS2010做的绘图板C#
评论
共有 条评论