WolfSHOT
WolfSHOT
CC#
Created by WolfSHOT on 1/24/2023 in #help
❔ c# help
public static void UnsetDNS()
{
var CurrentInterface = GetActiveEthernetOrWifiNetworkInterface();
if (CurrentInterface == null) return;

ManagementClass objMC = new ManagementClass("Win32_NetworkAdapterConfiguration");
ManagementObjectCollection objMOC = objMC.GetInstances();
foreach (ManagementObject objMO in objMOC)
{
if ((bool)objMO["IPEnabled"])
{
if (objMO["Description"].ToString().Equals(CurrentInterface.Description))
{
ManagementBaseObject objdns = objMO.GetMethodParameters("SetDNSServerSearchOrder");
if (objdns != null)
{
objdns["DNSServerSearchOrder"] = null;
objMO.InvokeMethod("SetDNSServerSearchOrder", objdns, null);
}
}
}
}
}
public static void UnsetDNS()
{
var CurrentInterface = GetActiveEthernetOrWifiNetworkInterface();
if (CurrentInterface == null) return;

ManagementClass objMC = new ManagementClass("Win32_NetworkAdapterConfiguration");
ManagementObjectCollection objMOC = objMC.GetInstances();
foreach (ManagementObject objMO in objMOC)
{
if ((bool)objMO["IPEnabled"])
{
if (objMO["Description"].ToString().Equals(CurrentInterface.Description))
{
ManagementBaseObject objdns = objMO.GetMethodParameters("SetDNSServerSearchOrder");
if (objdns != null)
{
objdns["DNSServerSearchOrder"] = null;
objMO.InvokeMethod("SetDNSServerSearchOrder", objdns, null);
}
}
}
}
}
4 replies
CC#
Created by WolfSHOT on 1/24/2023 in #help
❔ c# help
example code i changed to ipv4 can we set it for ipv6
4 replies
CC#
Created by WolfSHOT on 1/23/2023 in #help
❔ c# help
thanks
10 replies
CC#
Created by WolfSHOT on 1/23/2023 in #help
❔ c# help
Can I combine all files in one exe with visual studio?
10 replies
CC#
Created by WolfSHOT on 1/23/2023 in #help
❔ c# help
When I share the application, the resource folder remains in the application's folder and the pictures are in it.
10 replies
CC#
Created by WolfSHOT on 1/23/2023 in #help
❔ c# help
An application with pictures that I also designed for
10 replies
CC#
Created by WolfSHOT on 1/22/2023 in #help
❔ I have an application that changes dns with c#, but it is not working, can you help me?
dns changer like
28 replies
CC#
Created by WolfSHOT on 1/22/2023 in #help
❔ I have an application that changes dns with c#, but it is not working, can you help me?
28 replies
CC#
Created by WolfSHOT on 1/22/2023 in #help
❔ I have an application that changes dns with c#, but it is not working, can you help me?
Yeah
28 replies
CC#
Created by WolfSHOT on 1/22/2023 in #help
❔ I have an application that changes dns with c#, but it is not working, can you help me?
can you send me an application code that changes dns or a source code
28 replies
CC#
Created by WolfSHOT on 1/22/2023 in #help
❔ I have an application that changes dns with c#, but it is not working, can you help me?
28 replies
CC#
Created by WolfSHOT on 1/22/2023 in #help
❔ I have an application that changes dns with c#, but it is not working, can you help me?
What do you think objMOC is?
28 replies
CC#
Created by WolfSHOT on 1/22/2023 in #help
❔ I have an application that changes dns with c#, but it is not working, can you help me?
It ends without going inside the foreach loop
28 replies
CC#
Created by WolfSHOT on 1/22/2023 in #help
❔ I have an application that changes dns with c#, but it is not working, can you help me?
I don't know very well, can you explain a little more, what do you think is the problem?
28 replies
CC#
Created by WolfSHOT on 1/22/2023 in #help
❔ I have an application that changes dns with c#, but it is not working, can you help me?
does not show
28 replies
CC#
Created by WolfSHOT on 1/22/2023 in #help
❔ I have an application that changes dns with c#, but it is not working, can you help me?
I don't know either, I'm running the code, but it doesn't change with the dns I specified.
28 replies
CC#
Created by WolfSHOT on 1/22/2023 in #help
❔ I have an application that changes dns with c#, but it is not working, can you help me?
ChatGPT wrote the code
28 replies