diff --git a/Source/NETworkManager.Models/Export/ExportManager.TracerouteHopInfo.cs b/Source/NETworkManager.Models/Export/ExportManager.TracerouteHopInfo.cs index 875d2b2d5f..6523b291e6 100644 --- a/Source/NETworkManager.Models/Export/ExportManager.TracerouteHopInfo.cs +++ b/Source/NETworkManager.Models/Export/ExportManager.TracerouteHopInfo.cs @@ -47,11 +47,11 @@ private static void CreateCsv(IEnumerable collection, string var stringBuilder = new StringBuilder(); stringBuilder.AppendLine( - $"{nameof(TracerouteHopInfo.Hop)},{nameof(TracerouteHopInfo.Status1)},{nameof(TracerouteHopInfo.Time1)},{nameof(TracerouteHopInfo.Status2)},{nameof(TracerouteHopInfo.Time2)},{nameof(TracerouteHopInfo.Status3)}{nameof(TracerouteHopInfo.Time3)},{nameof(TracerouteHopInfo.IPAddress)},{nameof(TracerouteHopInfo.Hostname)},{nameof(TracerouteHopInfo.IPGeolocationResult.Info.Continent)},{nameof(TracerouteHopInfo.IPGeolocationResult.Info.Country)},{nameof(TracerouteHopInfo.IPGeolocationResult.Info.Region)},{nameof(TracerouteHopInfo.IPGeolocationResult.Info.City)},{nameof(TracerouteHopInfo.IPGeolocationResult.Info.District)},{nameof(TracerouteHopInfo.IPGeolocationResult.Info.Isp)},{nameof(TracerouteHopInfo.IPGeolocationResult.Info.Org)}, {nameof(TracerouteHopInfo.IPGeolocationResult.Info.As)},{nameof(TracerouteHopInfo.IPGeolocationResult.Info.Asname)},{nameof(TracerouteHopInfo.IPGeolocationResult.Info.Hosting)},{nameof(TracerouteHopInfo.IPGeolocationResult.Info.Proxy)},{nameof(TracerouteHopInfo.IPGeolocationResult.Info.Mobile)}"); + $"{nameof(TracerouteHopInfo.Hop)},{nameof(TracerouteHopInfo.Status1)},{nameof(TracerouteHopInfo.Time1)},{nameof(TracerouteHopInfo.Status2)},{nameof(TracerouteHopInfo.Time2)},{nameof(TracerouteHopInfo.Status3)},{nameof(TracerouteHopInfo.Time3)},{nameof(TracerouteHopInfo.IPAddress)},{nameof(TracerouteHopInfo.Hostname)},{nameof(TracerouteHopInfo.IPGeolocationResult.Info.Continent)},{nameof(TracerouteHopInfo.IPGeolocationResult.Info.Country)},{nameof(TracerouteHopInfo.IPGeolocationResult.Info.Region)},{nameof(TracerouteHopInfo.IPGeolocationResult.Info.City)},{nameof(TracerouteHopInfo.IPGeolocationResult.Info.District)},{nameof(TracerouteHopInfo.IPGeolocationResult.Info.Isp)},{nameof(TracerouteHopInfo.IPGeolocationResult.Info.Org)},{nameof(TracerouteHopInfo.IPGeolocationResult.Info.As)},{nameof(TracerouteHopInfo.IPGeolocationResult.Info.Asname)},{nameof(TracerouteHopInfo.IPGeolocationResult.Info.Hosting)},{nameof(TracerouteHopInfo.IPGeolocationResult.Info.Proxy)},{nameof(TracerouteHopInfo.IPGeolocationResult.Info.Mobile)}"); foreach (var info in collection) stringBuilder.AppendLine( - $"{info.Hop},{info.Status1},{Ping.TimeToString(info.Status1, info.Time1, true)},{info.Status2},{Ping.TimeToString(info.Status2, info.Time2, true)},{info.Status3},{Ping.TimeToString(info.Status3, info.Time3, true)},{info.IPAddress},{info.Hostname},{info.IPGeolocationResult.Info.Continent},{info.IPGeolocationResult.Info.Country},{info.IPGeolocationResult.Info.Region},{info.IPGeolocationResult.Info.City},{info.IPGeolocationResult.Info.District},{info.IPGeolocationResult.Info.Isp?.Replace(",", "")},{info.IPGeolocationResult.Info.Org?.Replace(",", "")},{info.IPGeolocationResult.Info.As?.Replace(",", "")},{info.IPGeolocationResult.Info.Asname?.Replace(",", "")},{info.IPGeolocationResult.Info.Hosting},{info.IPGeolocationResult.Info.Proxy},{info.IPGeolocationResult.Info.Mobile}"); + $"{info.Hop},{info.Status1},{Ping.TimeToString(info.Status1, info.Time1, true)},{info.Status2},{Ping.TimeToString(info.Status2, info.Time2, true)},{info.Status3},{Ping.TimeToString(info.Status3, info.Time3, true)},{info.IPAddress},{info.Hostname},{info.IPGeolocationResult?.Info?.Continent},{info.IPGeolocationResult?.Info?.Country},{info.IPGeolocationResult?.Info?.Region},{info.IPGeolocationResult?.Info?.City},{info.IPGeolocationResult?.Info?.District},{info.IPGeolocationResult?.Info?.Isp?.Replace(",", "")},{info.IPGeolocationResult?.Info?.Org?.Replace(",", "")},{info.IPGeolocationResult?.Info?.As?.Replace(",", "")},{info.IPGeolocationResult?.Info?.Asname?.Replace(",", "")},{info.IPGeolocationResult?.Info?.Hosting},{info.IPGeolocationResult?.Info?.Proxy},{info.IPGeolocationResult?.Info?.Mobile}"); File.WriteAllText(filePath, stringBuilder.ToString()); } @@ -82,29 +82,29 @@ from info in collection new XElement(nameof(TracerouteHopInfo.IPAddress), info.IPAddress), new XElement(nameof(TracerouteHopInfo.Hostname), info.Hostname), new XElement(nameof(TracerouteHopInfo.IPGeolocationResult.Info.Continent), - info.IPGeolocationResult.Info.Continent), + info.IPGeolocationResult?.Info?.Continent), new XElement(nameof(TracerouteHopInfo.IPGeolocationResult.Info.Country), - info.IPGeolocationResult.Info.Country), + info.IPGeolocationResult?.Info?.Country), new XElement(nameof(TracerouteHopInfo.IPGeolocationResult.Info.Region), - info.IPGeolocationResult.Info.Region), + info.IPGeolocationResult?.Info?.Region), new XElement(nameof(TracerouteHopInfo.IPGeolocationResult.Info.City), - info.IPGeolocationResult.Info.City), + info.IPGeolocationResult?.Info?.City), new XElement(nameof(TracerouteHopInfo.IPGeolocationResult.Info.District), - info.IPGeolocationResult.Info.District), + info.IPGeolocationResult?.Info?.District), new XElement(nameof(TracerouteHopInfo.IPGeolocationResult.Info.Isp), - info.IPGeolocationResult.Info.Isp), + info.IPGeolocationResult?.Info?.Isp), new XElement(nameof(TracerouteHopInfo.IPGeolocationResult.Info.Org), - info.IPGeolocationResult.Info.Org), + info.IPGeolocationResult?.Info?.Org), new XElement(nameof(TracerouteHopInfo.IPGeolocationResult.Info.As), - info.IPGeolocationResult.Info.As), + info.IPGeolocationResult?.Info?.As), new XElement(nameof(TracerouteHopInfo.IPGeolocationResult.Info.Asname), - info.IPGeolocationResult.Info.Asname), + info.IPGeolocationResult?.Info?.Asname), new XElement(nameof(TracerouteHopInfo.IPGeolocationResult.Info.Hosting), - info.IPGeolocationResult.Info.Hosting), + info.IPGeolocationResult?.Info?.Hosting), new XElement(nameof(TracerouteHopInfo.IPGeolocationResult.Info.Proxy), - info.IPGeolocationResult.Info.Proxy), + info.IPGeolocationResult?.Info?.Proxy), new XElement(nameof(TracerouteHopInfo.IPGeolocationResult.Info.Mobile), - info.IPGeolocationResult.Info.Mobile))))); + info.IPGeolocationResult?.Info?.Mobile))))); document.Save(filePath); } @@ -130,18 +130,18 @@ private static void CreateJson(IReadOnlyList collection, stri Time3 = Ping.TimeToString(collection[i].Status3, collection[i].Time3, true), IPAddress = collection[i].IPAddress?.ToString(), collection[i].Hostname, - collection[i].IPGeolocationResult.Info.Continent, - collection[i].IPGeolocationResult.Info.Country, - collection[i].IPGeolocationResult.Info.Region, - collection[i].IPGeolocationResult.Info.City, - collection[i].IPGeolocationResult.Info.District, - collection[i].IPGeolocationResult.Info.Isp, - collection[i].IPGeolocationResult.Info.Org, - collection[i].IPGeolocationResult.Info.As, - collection[i].IPGeolocationResult.Info.Asname, - collection[i].IPGeolocationResult.Info.Hosting, - collection[i].IPGeolocationResult.Info.Proxy, - collection[i].IPGeolocationResult.Info.Mobile + Continent = collection[i].IPGeolocationResult?.Info?.Continent, + Country = collection[i].IPGeolocationResult?.Info?.Country, + Region = collection[i].IPGeolocationResult?.Info?.Region, + City = collection[i].IPGeolocationResult?.Info?.City, + District = collection[i].IPGeolocationResult?.Info?.District, + Isp = collection[i].IPGeolocationResult?.Info?.Isp, + Org = collection[i].IPGeolocationResult?.Info?.Org, + As = collection[i].IPGeolocationResult?.Info?.As, + Asname = collection[i].IPGeolocationResult?.Info?.Asname, + Hosting = collection[i].IPGeolocationResult?.Info?.Hosting, + Proxy = collection[i].IPGeolocationResult?.Info?.Proxy, + Mobile = collection[i].IPGeolocationResult?.Info?.Mobile }; File.WriteAllText(filePath, JsonConvert.SerializeObject(jsonData, Formatting.Indented)); diff --git a/Source/NETworkManager.Models/Export/ExportManager.WiFiNetworkInfo.cs b/Source/NETworkManager.Models/Export/ExportManager.WiFiNetworkInfo.cs index 37a062527d..2730dcaa2c 100644 --- a/Source/NETworkManager.Models/Export/ExportManager.WiFiNetworkInfo.cs +++ b/Source/NETworkManager.Models/Export/ExportManager.WiFiNetworkInfo.cs @@ -47,7 +47,7 @@ private static void CreateCsv(IEnumerable collection, string fi var stringBuilder = new StringBuilder(); stringBuilder.AppendLine( - $"{nameof(WiFiNetworkInfo.AvailableNetwork.Bssid)},{nameof(WiFiNetworkInfo.AvailableNetwork.Ssid)},{nameof(WiFiNetworkInfo.AvailableNetwork.ChannelCenterFrequencyInKilohertz)},{nameof(WiFiNetworkInfo.AvailableNetwork.SignalBars)},{nameof(WiFiNetworkInfo.AvailableNetwork.IsWiFiDirect)},{nameof(WiFiNetworkInfo.AvailableNetwork.NetworkRssiInDecibelMilliwatts)},{nameof(WiFiNetworkInfo.AvailableNetwork.PhyKind)},{nameof(WiFiNetworkInfo.AvailableNetwork.NetworkKind)},{nameof(WiFiNetworkInfo.AvailableNetwork.SecuritySettings.NetworkAuthenticationType)},{nameof(WiFiNetworkInfo.AvailableNetwork.SecuritySettings.NetworkEncryptionType)},{nameof(WiFiNetworkInfo.AvailableNetwork.BeaconInterval)}.{nameof(WiFiNetworkInfo.AvailableNetwork.Uptime)}"); + $"{nameof(WiFiNetworkInfo.AvailableNetwork.Bssid)},{nameof(WiFiNetworkInfo.AvailableNetwork.Ssid)},{nameof(WiFiNetworkInfo.AvailableNetwork.ChannelCenterFrequencyInKilohertz)},{nameof(WiFiNetworkInfo.AvailableNetwork.SignalBars)},{nameof(WiFiNetworkInfo.AvailableNetwork.IsWiFiDirect)},{nameof(WiFiNetworkInfo.AvailableNetwork.NetworkRssiInDecibelMilliwatts)},{nameof(WiFiNetworkInfo.AvailableNetwork.PhyKind)},{nameof(WiFiNetworkInfo.AvailableNetwork.NetworkKind)},{nameof(WiFiNetworkInfo.AvailableNetwork.SecuritySettings.NetworkAuthenticationType)},{nameof(WiFiNetworkInfo.AvailableNetwork.SecuritySettings.NetworkEncryptionType)},{nameof(WiFiNetworkInfo.AvailableNetwork.BeaconInterval)},{nameof(WiFiNetworkInfo.AvailableNetwork.Uptime)}"); foreach (var info in collection) stringBuilder.AppendLine( @@ -111,7 +111,7 @@ private static void CreateJson(IReadOnlyList collection, string { collection[i].AvailableNetwork.Bssid, collection[i].AvailableNetwork.Ssid, - ChannelCenterFrequencyInKilohertz = collection[i].AvailableNetwork.Ssid, + ChannelCenterFrequencyInKilohertz = collection[i].AvailableNetwork.ChannelCenterFrequencyInKilohertz, SignalBars = collection[i].AvailableNetwork.SignalBars.ToString(), IsWiFiDirect = collection[i].AvailableNetwork.IsWiFiDirect.ToString(), NetworkRssiInDecibelMilliwatts = collection[i].AvailableNetwork.NetworkRssiInDecibelMilliwatts diff --git a/Website/docs/changelog/next-release.md b/Website/docs/changelog/next-release.md index 1734328e88..ff6a040824 100644 --- a/Website/docs/changelog/next-release.md +++ b/Website/docs/changelog/next-release.md @@ -88,6 +88,11 @@ Release date: **xx.xx.2025** ## Bug Fixes +**WiFi** + +- Fix potential error in export logic if some data is null. [#3291](https://github.com/BornToBeRoot/NETworkManager/pull/3291) +- Fix missing simicolon separators in CSV output. [#3291](https://github.com/BornToBeRoot/NETworkManager/pull/3291) + **IP Scanner** - Fix race condition when scan is complete but not all results have been processed yet, causing a wrong error message to be displayed. [#3287](https://github.com/BornToBeRoot/NETworkManager/pull/3287) @@ -98,6 +103,11 @@ Release date: **xx.xx.2025** - Fix race condition when scan is complete but not all results have been processed yet, causing a wrong error message to be displayed. [#3287](https://github.com/BornToBeRoot/NETworkManager/pull/3287) +**Traceroute** + +- Fix potential error in export logic if some data is null. [#3291](https://github.com/BornToBeRoot/NETworkManager/pull/3291) +- Fix missing simicolon separators in CSV output. [#3291](https://github.com/BornToBeRoot/NETworkManager/pull/3291) + **PowerShell** - Resolve the actual path to `pwsh.exe` under `C:\Program Files\WindowsApps\` instead of relying on the stub located at `%LocalAppData%\Microsoft\WindowsApps\`. The stub simply redirects to the real executable, and settings such as themes are applied only to the real binary via the registry. [#3246](https://github.com/BornToBeRoot/NETworkManager/pull/3246)