From cfbef3a2691ab4f8e33d449bcdb5c510af614635 Mon Sep 17 00:00:00 2001
From: valnoxy
Date: Sun, 24 Mar 2024 19:33:17 +0100
Subject: [PATCH] Update Readme & Code cleanup
---
CHANGELOG.md | 28 ----
CheckIP.CLI/CheckIP.CLI.sln | 25 ----
CheckIP.CLI/CheckIP.CLI/CheckIP.CLI.csproj | 14 --
CheckIP.CLI/CheckIP.CLI/Program.cs | 32 -----
CheckIP.Windows/CheckIP/MainWindow.xaml | 2 +-
CheckIP.Windows/CheckIP/Pages/MyIP.xaml.cs | 40 +++---
README.md | 159 ++++++++++++---------
7 files changed, 113 insertions(+), 187 deletions(-)
delete mode 100644 CHANGELOG.md
delete mode 100644 CheckIP.CLI/CheckIP.CLI.sln
delete mode 100644 CheckIP.CLI/CheckIP.CLI/CheckIP.CLI.csproj
delete mode 100644 CheckIP.CLI/CheckIP.CLI/Program.cs
diff --git a/CHANGELOG.md b/CHANGELOG.md
deleted file mode 100644
index 001eee0..0000000
--- a/CHANGELOG.md
+++ /dev/null
@@ -1,28 +0,0 @@
-CheckIP
-Get more information about an IP address
-
-
- Report Bug
- ·
- View Changelog
-
-
-
-![-----------------------------------------------------](https://dl.exploitox.de/t440p-oc/rainbow.png)
-
-## Changelog
-
-### Version 2.1.0
-- Add mobile source code (iOS & Android)
-- Add Windows 11 UI for Windows 10 users
-- Update libraries
-- Add CLI project (WIP)
-
-### Version 2.0.0
-- New UI for Windows 11 users
-
-### Version 1.0.1
-- Add feature to parse IP by pressing ENTER.
-
-### Version 1.0.0
-- Initial release
\ No newline at end of file
diff --git a/CheckIP.CLI/CheckIP.CLI.sln b/CheckIP.CLI/CheckIP.CLI.sln
deleted file mode 100644
index 7f7cfe5..0000000
--- a/CheckIP.CLI/CheckIP.CLI.sln
+++ /dev/null
@@ -1,25 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio Version 17
-VisualStudioVersion = 17.2.32408.312
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CheckIP.CLI", "CheckIP.CLI\CheckIP.CLI.csproj", "{4BA51A99-A14B-4A93-ACA1-FD8C27CE8525}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Any CPU = Debug|Any CPU
- Release|Any CPU = Release|Any CPU
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {4BA51A99-A14B-4A93-ACA1-FD8C27CE8525}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {4BA51A99-A14B-4A93-ACA1-FD8C27CE8525}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {4BA51A99-A14B-4A93-ACA1-FD8C27CE8525}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {4BA51A99-A14B-4A93-ACA1-FD8C27CE8525}.Release|Any CPU.Build.0 = Release|Any CPU
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
- GlobalSection(ExtensibilityGlobals) = postSolution
- SolutionGuid = {3BBC0C94-AF69-4273-8ACB-FBFCCF878B67}
- EndGlobalSection
-EndGlobal
diff --git a/CheckIP.CLI/CheckIP.CLI/CheckIP.CLI.csproj b/CheckIP.CLI/CheckIP.CLI/CheckIP.CLI.csproj
deleted file mode 100644
index 313a173..0000000
--- a/CheckIP.CLI/CheckIP.CLI/CheckIP.CLI.csproj
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
- Exe
- net6.0
- enable
- enable
-
-
-
-
-
-
-
diff --git a/CheckIP.CLI/CheckIP.CLI/Program.cs b/CheckIP.CLI/CheckIP.CLI/Program.cs
deleted file mode 100644
index cb7c789..0000000
--- a/CheckIP.CLI/CheckIP.CLI/Program.cs
+++ /dev/null
@@ -1,32 +0,0 @@
-using CommandLine;
-using CommandLine.Text;
-using System;
-
-namespace CheckIP.CLI
-{
- internal class Program
- {
- public class Options
- {
- [Usage(ApplicationAlias = "CheckIP")]
-
- [Value(index: 0, Required = true, HelpText = "Image file Path to analyze.")]
- public string Path { get; set; }
-
- [Option(shortName: 'c', longName: "confidence", Required = false, HelpText = "Minimum confidence.", Default = 0.9f)]
- public float Confidence { get; set; }
- }
-
- static void Main(string[] args)
- {
- CommandLine.Parser.Default.ParseArguments(args)
- .WithParsed(o => {
- // parsing successful; go ahead and run the app
- })
- .WithNotParsed(e => {
- // parsing unsuccessful; deal with parsing errors
- });
- Console.WriteLine("Hello World.");
- }
- }
-}
\ No newline at end of file
diff --git a/CheckIP.Windows/CheckIP/MainWindow.xaml b/CheckIP.Windows/CheckIP/MainWindow.xaml
index e4438eb..2cb33ee 100644
--- a/CheckIP.Windows/CheckIP/MainWindow.xaml
+++ b/CheckIP.Windows/CheckIP/MainWindow.xaml
@@ -68,7 +68,7 @@
-
+
\ No newline at end of file
diff --git a/CheckIP.Windows/CheckIP/Pages/MyIP.xaml.cs b/CheckIP.Windows/CheckIP/Pages/MyIP.xaml.cs
index 30f64db..4728947 100644
--- a/CheckIP.Windows/CheckIP/Pages/MyIP.xaml.cs
+++ b/CheckIP.Windows/CheckIP/Pages/MyIP.xaml.cs
@@ -1,13 +1,13 @@
using Microsoft.Win32;
using System;
using System.IO;
-using System.Net;
using System.Threading.Tasks;
using System.Windows;
using System.Net.NetworkInformation;
using System.ComponentModel;
using CheckIP.Common;
using System.Collections.Generic;
+using System.Net.Http;
namespace CheckIP
{
@@ -17,17 +17,17 @@ namespace CheckIP
public partial class MyIP
{
private static string _myIp;
- private readonly Queue workQueue = new Queue();
- private readonly object queueLock = new object();
- private readonly BackgroundWorker worker = new BackgroundWorker();
+ private readonly Queue _workQueue = new Queue();
+ private readonly object _queueLock = new object();
+ private readonly BackgroundWorker _worker = new BackgroundWorker();
public MyIP()
{
InitializeComponent();
_myIp = Task.Run(_GetIPAddress).GetAwaiter().GetResult();
- worker.DoWork += Worker_DoWork;
- worker.RunWorkerCompleted += Worker_RunWorkerCompleted;
+ _worker.DoWork += Worker_DoWork;
+ _worker.RunWorkerCompleted += Worker_RunWorkerCompleted;
// Trigger NetworkChange
NetworkChange.NetworkAddressChanged += NetworkChange_NetworkAvailabilityChanged;
@@ -52,19 +52,19 @@ private void FetchAndParse()
});
}
- [Obsolete("Will be replaced to a async version soon.")]
private static async Task _GetIPAddress()
{
string result = null;
+ using var client = new HttpClient();
try
{
- result = await Task.Run(() => new WebClient().DownloadString("https://ifconfig.me/ip"));
+ result = await client.GetStringAsync("https://ifconfig.me/ip");
}
catch
{
try // Alternative source
{
- result = await Task.Run(() => new WebClient().DownloadString("https://api.ipify.org"));
+ result = await client.GetStringAsync("https://api.ipify.org");
}
catch
{
@@ -164,12 +164,12 @@ private void ExportBtn_OnClick(object sender, RoutedEventArgs e)
private void EnqueueWork(Action work)
{
- lock (queueLock)
+ lock (_queueLock)
{
- workQueue.Enqueue(work);
- if (!worker.IsBusy)
+ _workQueue.Enqueue(work);
+ if (!_worker.IsBusy)
{
- worker.RunWorkerAsync();
+ _worker.RunWorkerAsync();
}
}
}
@@ -177,11 +177,11 @@ private void EnqueueWork(Action work)
private void Worker_DoWork(object sender, DoWorkEventArgs e)
{
Action work = null;
- lock (queueLock)
+ lock (_queueLock)
{
- if (workQueue.Count > 0)
+ if (_workQueue.Count > 0)
{
- work = workQueue.Dequeue();
+ work = _workQueue.Dequeue();
}
}
@@ -190,11 +190,11 @@ private void Worker_DoWork(object sender, DoWorkEventArgs e)
private void Worker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
{
- lock (queueLock)
+ lock (_queueLock)
{
- if (workQueue.Count > 0)
+ if (_workQueue.Count > 0)
{
- worker.RunWorkerAsync();
+ _worker.RunWorkerAsync();
}
}
}
@@ -203,7 +203,7 @@ private void NetworkChange_NetworkAvailabilityChanged(object sender, EventArgs e
{
EnqueueWork(() =>
{
- _myIp = Task.Run(() => _GetIPAddress()).GetAwaiter().GetResult();
+ _myIp = Task.Run(_GetIPAddress).GetAwaiter().GetResult();
FetchAndParse();
});
}
diff --git a/README.md b/README.md
index e7308e7..1629476 100644
--- a/README.md
+++ b/README.md
@@ -1,76 +1,101 @@
-# CheckIP - IP Informations
-
-
-
-[![Android](https://img.shields.io/badge/Android-Xamarin-brightgreen.svg)](https://github.com/valnoxy/checkip/tree/main/CheckIP.Mobile)
-[![iOS](https://img.shields.io/badge/iOS-Xamarin-green)](https://github.com/valnoxy/checkip/tree/main/CheckIP.Mobile)
-[![Windows](https://img.shields.io/badge/Windows-WPF-blue)](https://github.com/valnoxy/checkip/tree/main/CheckIP.Windows)
-[![License](https://img.shields.io/badge/license-GNU%20General%20Public%20License-purple)](/LICENSE)
-[![Downloads](https://img.shields.io/github/downloads/valnoxy/checkip/total.svg)](https://github.com/valnoxy/checkip/releases)
-
- Status: Maintained
-
- WPF Version: 2.2.1
-
- Xamarin Version: 2.1.0-alpha2
-
- Report Bug
- ·
- Download
+
+
+
+
+
+
+
+
+
+ [![Version][version-shield]][version-url]
+ [![Download Counter][downloads-shield]][downloads-url]
+ [![License][license-shield]][license-url]
+
+
+[version-shield]: https://img.shields.io/github/v/release/valnoxy/checkip?color=9565F6
+[version-url]: https://github.com/valnoxy/checkip/releases
+
+[downloads-shield]: https://img.shields.io/github/downloads/valnoxy/checkip/total.svg?color=431D93
+[downloads-url]: https://github.com/valnoxy/checkip/releases
+
+[license-shield]: https://img.shields.io/github/license/valnoxy/checkip?color=9565F6
+[license-url]: https://img.shields.io/github/license/valnoxy/checkip
+
+
+
CheckIP
+
+
Discover the World Behind Every Address!
+
+
+ Report Bug
+ ·
+ Discussions
+
+
+ 🎉 Version 2.3.0 for Windows is out. Check out the release notes
+ here.
+
+
-
-
-
-
-
-## About CheckIP
-CheckIP is a GUI based application which can provide much information about an IP address.
-
-## Screenshots
-
-
-## Download
-[![GooglePlay](https://dl.exploitox.de/checkip/PlayStoreBadge.png)](https://play.google.com/store/apps/details?id=dev.valnoxy.checkip)
-[![AppStore](https://dl.exploitox.de/checkip/AppStoreBadge.png)](https://apps.apple.com/us/app/checkip-ip-informations/id1618841457)
-[![MicrosoftStore](https://dl.exploitox.de/checkip/MicrosoftStoreBadge.png)](https://www.microsoft.com/store/apps/9NFGS0SX9CP3)
+
-Join iOS Beta via TestFlight (currently closed) »
-
-> Note: The mobile applications are currently in beta. The MAUI source base is outdated and and exists only for archival purposes. After MAUI is more stable, this project will move from Xamarin to MAUI.
-
-## Localization
-Want to add a new language or revise an existing one? Great! Follow these steps so you can translate CheckIP:
-
-1. Clone this Repository
-2. Copy ```Localization\ResourceDirectory.xaml``` and paste your country code into the new file name (e.g. ```ResourceDirectory.de-DE.xaml```).
-3. Open ```Pages\App.xaml``` and add a reference to the new file under ```MergedDictionaries```.
-
- ``````
-
-4. Open ```Pages\Main.xaml.cs```, go to the function ```Main``` and add your country code in the switch/case function with reference to the new file.
- ```c#
- switch (language)
- {
- default:
- case "en-US":
- dict.Source = new Uri(@"/CheckIP;component/Localization/ResourceDictionary.xaml", UriKind.Relative);
- break;
- case "de-DE":
- dict.Source = new Uri(@"/CheckIP;component/Localization/ResourceDictionary.de-DE.xaml", UriKind.Relative);
- break;
- }
- ```
-
-5. Modify your new file as you wish by translating the value of each variable.
-6. When you are ready, you can open a pull request.
+---
-## License (GNU GPL)
+
+
+ 🏁 Table of Contents
+
+ - Introduction
+ -
+ Installation methods
+
+
+ - Screenshot
+ - Libraries
+ - License
+
+
+
+
+
+# 🚀Introduction
+CheckIP is a GUI-based application that provides comprehensive information about an IP address. Whether you’re curious about the geographical location, network details, or other relevant data related to an IP, CheckIP has you covered.
+
+# 🤸 Installation methods
+
+> [!NOTE]
+> The Linux/Mac/Mobile version of CheckIP will be released at a later date.
+
+## 🛍️ 1. Install via Microsoft Store
+CheckIP is available in the Microsoft Store for free.
+
+
+
+
+
+## 💿 2. Install via Setup
+You can find the setup files here on GitHub. Simply download and run the setup assistant to install CheckIP
+
+# 🖼️ Screenshot
+
+
+# 🙏 Libraries
+This project uses the following libraries:
+- [Flag Icons](https://icons8.com)
+- [Hardcodet.NotifyIcon.Wpf](https://github.com/hardcodet/wpf-notifyicon)
+- [Newtonsoft.Json](https://www.newtonsoft.com/json)
+- [WPF-UI](https://github.com/lepoco/wpfui)
+
+# 🧾 License
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
-
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@@ -88,9 +113,9 @@ GNU General Public License for more details.
---
-© 2018 - 2023 valnoxy. All Rights Reserved.
+© 2018 - 2024 valnoxy. All Rights Reserved.
By Jonas Günner <jonas@exploitox.de>
-
+