From 1b2c7b8256aac40ec7ff64edfedbda70e76e127b Mon Sep 17 00:00:00 2001 From: Your Name Date: Mon, 31 Mar 2025 16:22:11 +0200 Subject: [PATCH] push init --- App.config | 6 ++++ Program.cs | 39 ++++++++++++++++++++ Properties/AssemblyInfo.cs | 33 +++++++++++++++++ SharpDNSResolver.csproj | 73 ++++++++++++++++++++++++++++++++++++++ SharpDNSResolver.sln | 31 ++++++++++++++++ 5 files changed, 182 insertions(+) create mode 100644 App.config create mode 100644 Program.cs create mode 100644 Properties/AssemblyInfo.cs create mode 100644 SharpDNSResolver.csproj create mode 100644 SharpDNSResolver.sln diff --git a/App.config b/App.config new file mode 100644 index 0000000..56efbc7 --- /dev/null +++ b/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Program.cs b/Program.cs new file mode 100644 index 0000000..f1dbccd --- /dev/null +++ b/Program.cs @@ -0,0 +1,39 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net; +using System.Text; +using System.Threading.Tasks; + +namespace SharpDNSResolver +{ + class DNSResolver + { + static void Main(string[] args) + { + try + { + if(args.Count() == 0) + { + Console.WriteLine("You must provide an host!"); + Environment.Exit(1); + } + string hostname = args[0]; + IPHostEntry hostEntry = Dns.GetHostEntry(hostname); + + Console.WriteLine($"Host : {hostEntry.HostName}"); + + Console.WriteLine("Ip address:"); + foreach (IPAddress ipAddress in hostEntry.AddressList) + { + Console.WriteLine($" {ipAddress}"); + } + } + catch (System.Net.Sockets.SocketException ex) + { + Console.WriteLine($"Error : {ex.Message}"); + } + } + } + +} diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..dd8a614 --- /dev/null +++ b/Properties/AssemblyInfo.cs @@ -0,0 +1,33 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// Les informations générales relatives à un assembly dépendent de +// l'ensemble d'attributs suivant. Changez les valeurs de ces attributs pour modifier les informations +// associées à un assembly. +[assembly: AssemblyTitle("SharpDNSResolver")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Vagrant")] +[assembly: AssemblyProduct("SharpDNSResolver")] +[assembly: AssemblyCopyright("Copyright © Vagrant 2025")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// L'affectation de la valeur false à ComVisible rend les types invisibles dans cet assembly +// aux composants COM. Si vous devez accéder à un type dans cet assembly à partir de +// COM, affectez la valeur true à l'attribut ComVisible sur ce type. +[assembly: ComVisible(false)] + +// Le GUID suivant est pour l'ID de la typelib si ce projet est exposé à COM +[assembly: Guid("82edc38c-802e-4c68-b543-5b8f8f187a2f")] + +// Les informations de version pour un assembly se composent des quatre valeurs suivantes : +// +// Version principale +// Version secondaire +// Numéro de build +// Révision +// +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/SharpDNSResolver.csproj b/SharpDNSResolver.csproj new file mode 100644 index 0000000..f2beb7d --- /dev/null +++ b/SharpDNSResolver.csproj @@ -0,0 +1,73 @@ + + + + + Debug + AnyCPU + {82EDC38C-802E-4C68-B543-5B8F8F187A2F} + Exe + SharpDNSResolver + SharpDNSResolver + v4.7.2 + 512 + true + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + true + bin\x64\Debug\ + DEBUG;TRACE + full + x64 + 7.3 + prompt + true + + + bin\x64\Release\ + TRACE + true + pdbonly + x64 + 7.3 + prompt + true + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/SharpDNSResolver.sln b/SharpDNSResolver.sln new file mode 100644 index 0000000..07f5f9a --- /dev/null +++ b/SharpDNSResolver.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.13.35806.99 d17.13 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpDNSResolver", "SharpDNSResolver.csproj", "{82EDC38C-802E-4C68-B543-5B8F8F187A2F}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|x64 = Debug|x64 + Release|Any CPU = Release|Any CPU + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {82EDC38C-802E-4C68-B543-5B8F8F187A2F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {82EDC38C-802E-4C68-B543-5B8F8F187A2F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {82EDC38C-802E-4C68-B543-5B8F8F187A2F}.Debug|x64.ActiveCfg = Debug|x64 + {82EDC38C-802E-4C68-B543-5B8F8F187A2F}.Debug|x64.Build.0 = Debug|x64 + {82EDC38C-802E-4C68-B543-5B8F8F187A2F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {82EDC38C-802E-4C68-B543-5B8F8F187A2F}.Release|Any CPU.Build.0 = Release|Any CPU + {82EDC38C-802E-4C68-B543-5B8F8F187A2F}.Release|x64.ActiveCfg = Release|x64 + {82EDC38C-802E-4C68-B543-5B8F8F187A2F}.Release|x64.Build.0 = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {4BF8A7CD-C719-4C81-9904-113588B78BC4} + EndGlobalSection +EndGlobal