C
C#2y ago
2yxle

solved

I am trying to disable FTH when clicking a button using registry, but I don't think it changes the enable value when clicked Here is my code: Registry.SetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\FTH", "Enabled", 0, RegistryValueKind.DWord); this is for when clicking a button.
31 Replies
phaseshift
phaseshift2y ago
are you sure it doesnt throw, ie you dont have sufficient permissions?
2yxle
2yxleOP2y ago
i can change it through the registry editor, but i cannot change it when clicking a button in visual studio. i have administrator perms in visual.
phaseshift
phaseshift2y ago
yeah, but when your program is launched, it might not inherit the admin rights? if you launch it manually by right-clicking and elevating, does it work then?
2yxle
2yxleOP2y ago
nope running it as an administrator doesnt change the value still
phaseshift
phaseshift2y ago
you need to verify your method is not throwing, still That's the only other suggestion I have
2yxle
2yxleOP2y ago
im trying to change the value of enabled to 0 when disabling fault tolerant heap when clicking a button, but the value wont change, and it stays to 1.
phaseshift
phaseshift2y ago
yes, and now verify that the method doesnt throw...
2yxle
2yxleOP2y ago
wdym sorry im new to visual studio
phaseshift
phaseshift2y ago
Registry.SetValue either works, or it throws an exception $debug to verify that it doesnt throw
MODiX
MODiX2y ago
Tutorial: Debug C# code - Visual Studio (Windows)
Learn features of the Visual Studio debugger and how to start the debugger, step through code, and inspect data in a C# application.
phaseshift
phaseshift2y ago
put a breakpoint on the call, then step-over to see what happens
2yxle
2yxleOP2y ago
alr ty
phaseshift
phaseshift2y ago
If something is thrown, studio will pause, and show a dialogue
2yxle
2yxleOP2y ago
alr
phaseshift
phaseshift2y ago
Otherwise the code will just move to the next line.
2yxle
2yxleOP2y ago
2yxle
2yxleOP2y ago
so uh i dont know what to pick i need it to run as an administrator, so i can start debugging it
phaseshift
phaseshift2y ago
well thats saying you need to change in order to have admin
2yxle
2yxleOP2y ago
alr no issues were found, nothing paused, but it doesnt change the value
phaseshift
phaseshift2y ago
I'm out of ideas, unless you typo'd something in the registry key
2yxle
2yxleOP2y ago
here is the key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\FTH
phaseshift
phaseshift2y ago
did you put a breakpoint on the method to ensure its being hit?
2yxle
2yxleOP2y ago
?
phaseshift
phaseshift2y ago
put a breakpoint on REgistry.SetValue
2yxle
2yxleOP2y ago
alr
phaseshift
phaseshift2y ago
like I said way up here, and then you said noproblems...
2yxle
2yxleOP2y ago
wait, now i have an error
phaseshift
phaseshift2y ago
that, err, doesnt look related
2yxle
2yxleOP2y ago
so it is harmless on my application?
phaseshift
phaseshift2y ago
thats a visual studio problem, not a 'your app' problem
2yxle
2yxleOP2y ago
alr ty again it might be an antivirus problem
Want results from more Discord servers?
Add your server