diff --git a/DNS-Swapper/DNS-Swapper.csproj b/DNS-Swapper/DNS-Swapper.csproj index 2410136..1a33303 100644 --- a/DNS-Swapper/DNS-Swapper.csproj +++ b/DNS-Swapper/DNS-Swapper.csproj @@ -27,7 +27,7 @@ false true 0 - 1.5.2.%2a + 1.5.3.%2a false true @@ -192,8 +192,8 @@ - - + del DNS-Swapper.exe +..\..\..\packages\ILRepack.2.0.18\tools\ILRepack.exe /out:"DNS-Swapper.exe" DNS-Swapper-nodll.exe AutoUpdater.NET.dll IPAddressControlLib.dll diff --git a/DNS-Swapper/NetworkManagement.cs b/DNS-Swapper/NetworkManagement.cs index 2e7d348..38dfc05 100644 --- a/DNS-Swapper/NetworkManagement.cs +++ b/DNS-Swapper/NetworkManagement.cs @@ -100,41 +100,6 @@ public void setGateway(string gateway) } } - /// - /// Set's the DNS Server of the local machine - /// - /// NIC address - /// DNS server address - /// Requires a reference to the System.Management namespace - public static void setDNS(string NIC, string DNS) - { - ConnectionOptions options = PrepareOptions(); - ManagementScope scope = PrepareScope(Environment.MachineName, options, @"\root\CIMV2"); - ManagementPath managementPath = new ManagementPath("Win32_NetworkAdapterConfiguration"); - ObjectGetOptions objectGetOptions = new ObjectGetOptions(); - ManagementClass mc = new ManagementClass(scope, managementPath, objectGetOptions); - ManagementObjectCollection moc = mc.GetInstances(); - foreach (ManagementObject mo in moc) - { - if ((bool)mo["IPEnabled"]) - { - if (mo["Caption"].ToString().Contains(NIC)) - { - try - { - ManagementBaseObject newDNS = mo.GetMethodParameters("SetDNSServerSearchOrder"); - newDNS["DNSServerSearchOrder"] = DNS.Split(','); - ManagementBaseObject setDNS = mo.InvokeMethod("SetDNSServerSearchOrder", newDNS, null); - } - catch (Exception e) - { - throw; - } - } - } - } - } - public static IPAddress getDNS(string NICname) { NetworkInterface[] networkInterfaces = NetworkInterface.GetAllNetworkInterfaces(); diff --git a/DNS-Swapper/Properties/AssemblyInfo.cs b/DNS-Swapper/Properties/AssemblyInfo.cs index 8c0fd24..a25590e 100644 --- a/DNS-Swapper/Properties/AssemblyInfo.cs +++ b/DNS-Swapper/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.5.2.0")] -[assembly: AssemblyFileVersion("1.5.2.0")] +[assembly: AssemblyVersion("1.5.3.0")] +[assembly: AssemblyFileVersion("1.5.3.0")]