❔ I have an application that changes dns with c#, but it is not working, can you help me?
23 Replies
ChatGPT wrote the code
What does "it is not working" actually mean, in practice?
I don't know either, I'm running the code, but it doesn't change with the dns I specified.
Right, so it appears to work, but your dns settings stay the same?
Does it show the "DNS servers changed successfully" message box?
does not show
OK, so one of those if statements isn't matching. Debug your code and find out why
I don't know very well, can you explain a little more, what do you think is the problem?
Looking at the code, you're not entering that try. So either the foreach loop isn't looping over anything, or the if statement inside it isn't matching
(if you did enter the try, you'd show a message box of one sort or another, which isn't happening)
So, debug the code. See whether the foreach loop is looping over anything. Look at the conditions in the if, see which one isn't matching. Then work out why.
It ends without going inside the foreach loop
OK, so find out why objMOC is empty
See how we're narrowing down the problem?
What do you think objMOC is?
Why does my opinion matter, heh? It's right there in your code
$code
To post C# code type the following:
```cs
// code here
```
Get an example by typing
$codegif
in chat
If your code is too long, post it to: https://paste.mod.gg/ime chatgpt gives broken or even straight up wrong code more often than the reverse
BlazeBin - kzqlelzrbzwi
A tool for sharing your source code with the world!
can you send me an application code that changes dns or a source code
"changes dns" what do you mean by that? the setting in the os?
Yeah
GitHub
GitHub - Zaczero/DNSChanger: 🔧 The ultimate Windows DNS changer too...
🔧 The ultimate Windows DNS changer tool (with DNSCrypt) - GitHub - Zaczero/DNSChanger: 🔧 The ultimate Windows DNS changer tool (with DNSCrypt)
dns changer like
Stack Overflow
How to Change DNS with C# on Windows 10
I'm trying to change the DNS on Windows 10 through VB.NET.
I have code that works on Windows 7, however it does not work on Windows 10.
Here is my code for Windows 7 that changes the DNS:
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.