3
It is possible to build an application which it searches for a key in the Windows registry with an exact name and when finding change its value by a user-defined value?
If possible what is the best language to implement this? VB.NET?!
3
It is possible to build an application which it searches for a key in the Windows registry with an exact name and when finding change its value by a user-defined value?
If possible what is the best language to implement this? VB.NET?!
6
Yes, it is possible.
In C#:
using (RegistryKey key = Registry.LocalMachine.OpenSubKey("oMeuCaminho"))
{
if (key != null)
key.SetValue("nomeDaMinhaChave", "valorDaMinhaChave", RegistryValueKind.String);
}
Or in VB.NET:
Registry.SetValue("oMeuCaminho", "nomeDaMinhaChave", "valorDaMinhaChave")
vlw! @Omni for feedback...
0
the best way I could find was this
c#
const string userRoot = @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings";
// onde "1" vc habilita o proxy e "0" vc desabilita.
Registry.SetValue(userRoot, "ProxyEnable", "1", RegistryValueKind.DWord);
// informe o endereço ip junto da porta para acesso ao proxy, vazio "" desabilita função
Registry.SetValue(userRoot, "ProxyServer", "192.168.0.254:2555", RegistryValueKind.String);
Browser other questions tagged .net windows vb.net visual-basic-6
You are not signed in. Login or sign up in order to post.
It seems to me that your question is too wide. Not to mention you may be breaching some Microsoft usage term :P
– CesarMiguel
It’s possible, I’ve done something similar in C++.
– Math
@I don’t think you’re breaking any laws. Being that it is just a software that does exactly the same thing you can do manually, there is no way you have an extra privilege only because it is changing keys through code.
– Math
@Math, I just assumed that I could break it. Now whether you do it or not, I don’t know. But you might actually be right :)
– CesarMiguel
Do you have any more instruction to give me @Math?! A light, a path? D I don’t know where to start...
– Luitame
@Luitame the answer below should help you. If it was in C++ I would say to use
TRegistry
.– Math
Vlw @Math... I saw the answer now! Abs
– Luitame