Skip to content

Commit 9bef52b

Browse files
committed
* Fixed incorrect CSV format
* Added hostname to export options * Minor design change
1 parent 3da4bba commit 9bef52b

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

Advanced PortChecker/Classes/ExportWriter.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ internal static void SaveAsText(string path, ItemsControl lvPorts)
2929
LvCheck l = (LvCheck)lvPorts.Items[i];
3030
if (i == lvPorts.Items.Count - 1)
3131
{
32-
sw.Write(l.Address + "\t" + l.Port + "\t" + l.Type + "\t" + l.Description);
32+
sw.Write(l.Address + "\t" + l.Port + "\t" + l.HostName + "\t" + l.Type + "\t" + l.Description);
3333
}
3434
else
3535
{
36-
sw.WriteLine(l.Address + "\t" + l.Port + "\t" + l.Type + "\t" + l.Description);
36+
sw.WriteLine(l.Address + "\t" + l.Port + "\t" + l.HostName + "\t" + l.Type + "\t" + l.Description);
3737
}
3838
}
3939
}
@@ -69,10 +69,10 @@ internal static void SaveAsHTML(string path, ItemsControl lvPorts)
6969

7070
sw.WriteLine("<h1>Export list</h1>");
7171
sw.WriteLine("<table border='1'>");
72-
sw.WriteLine("<tr><th>Address</th><th>Port</th><th>Type</th><th>Description</th></tr>");
72+
sw.WriteLine("<tr><th>Address</th><th>Port</th><th>Host name</th><th>Type</th><th>Description</th></tr>");
7373
foreach (LvCheck l in lvPorts.Items)
7474
{
75-
sw.WriteLine("<tr><td>" + l.Address + "</td><td>" + l.Port + "</td><td>" + l.Type + "</td><td>" + l.Description + "</td></tr>");
75+
sw.WriteLine("<tr><td>" + l.Address + "</td><td>" + l.Port + "</td><td>"+ l.HostName + "</td><td>" + l.Type + "</td><td>" + l.Description + "</td></tr>");
7676
}
7777
sw.WriteLine("</table>");
7878

@@ -100,17 +100,17 @@ internal static void SaveAsCSV(string path, ItemsControl lvPorts)
100100
{
101101
using (StreamWriter sw = new StreamWriter(path))
102102
{
103-
sw.WriteLine("Advanced PortChecker;" + DateTime.Now);
103+
sw.WriteLine("Advanced PortChecker," + DateTime.Now);
104104
for (int i = 0; i < lvPorts.Items.Count; i++)
105105
{
106106
LvCheck l = (LvCheck)lvPorts.Items[i];
107107
if (i == lvPorts.Items.Count - 1)
108108
{
109-
sw.Write(l.Address + ";" + l.Port + ";" + l.Type + ";" + l.Description);
109+
sw.Write(l.Address + "," + l.Port + "," + l.HostName + "," + l.Type + "," + l.Description);
110110
}
111111
else
112112
{
113-
sw.WriteLine(l.Address + ";" + l.Port + ";" + l.Type + ";" + l.Description);
113+
sw.WriteLine(l.Address + "," + l.Port + "," + l.HostName + "," + l.Type + "," + l.Description);
114114
}
115115
}
116116
}

Advanced PortChecker/Windows/AboutWindow.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
77
xmlns:syncfusion="http://schemas.syncfusion.com/wpf"
88
mc:Ignorable="d"
9-
Title="Advanced PortChecker - About" Height="250" Width="400"
9+
Title="Advanced PortChecker - About" Height="220" Width="400"
1010
UseLayoutRounding="True"
1111
Icon="/Advanced PortChecker;component/globe.ico" WindowStartupLocation="CenterScreen"
1212
AllowsTransparency="True" TitleTextAlignment="Center">

Advanced PortChecker/Windows/MainWindow.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ private void BtnCopy_Click(object sender, RoutedEventArgs e)
234234
if (LvPorts.SelectedItems.Count == 0) return;
235235

236236
LvCheck selected = (LvCheck) LvPorts.SelectedItems[0];
237-
Clipboard.SetText(selected.Address + " " + selected.Port + " " + selected.Type + " " + selected.Description);
237+
Clipboard.SetText(selected.Address + " " + selected.Port + " " + selected.HostName + " " + selected.Type + " " + selected.Description);
238238
}
239239

240240
private void BtnExportAs_Click(object sender, RoutedEventArgs e)

0 commit comments

Comments
 (0)