AÇIKLAMABu program C++ Builder 6 projesidir.
Bu program ile birlikte dns adreslerinizi 208.67.220.220 , 208.67.222.222 adreslerinize yönlendirebilirsiniz. Yapılacak modifikasyonlarla birlikte dns adresleri değiştirelebilir. Program arka planda çalışabilecek şekilde ayarlanabilir. Dns değişikliğinin anında etkili olabilmesi için bilgisayara reset atma kodu da projeye eklenebilir.
Programın Tamamını Aşağıdaki Linkten İndirebilirsiniz

Program Kodu:
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "Unit1.h"
#include "Registry.hpp"
String tut="SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\\Interfaces";
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
TRegistry *Reg=new TRegistry;
Reg->RootKey=HKEY_LOCAL_MACHINE;
if(Reg->OpenKey(tut,false))
{
Reg->GetKeyNames(ListBox1->Items);
Reg->CloseKey();
}
for(int i=0;i<ListBox1->Items->Count;i++)
{
String put=tut;
put=put+"\\"+ListBox1->Items->Strings[i];
TRegistry *Feg=new TRegistry;
Feg->RootKey=HKEY_LOCAL_MACHINE;
if(Feg->OpenKey(put,false))
{
ListBox2->Items->Clear();
Feg->GetValueNames(ListBox2->Items);
int saydir=0;
String defaultgateway="DhcpDefaultGateway";
String dhcpipadres="DhcpIPAddress";
String dhcpnameserver="DhcpNameServer";
for(int p=0;p<ListBox2->Items->Count;p++)
{
if(defaultgateway==ListBox2->Items->Strings[p])
saydir++;
if(dhcpipadres==ListBox2->Items->Strings[p])
saydir++;
if(dhcpnameserver==ListBox2->Items->Strings[p])
saydir++;
}
if(saydir==3)
{
TRegistry *Heg=new TRegistry;
Heg->RootKey=HKEY_LOCAL_MACHINE;
if(Heg->OpenKey(put,false))
{
Heg->DeleteValue("NameServer");
Heg->WriteString("NameServer","208.67.222.222,208.67.220.220");
Heg->CloseKey();
}
}
}//if sonu
}// for sonu
}
//---------------------------------------------------------------------------