DNS Değiştirme

Pazar, 19 Nisan 2009 14:15 NEO
Yazdır
AÇIKLAMA

Bu 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:

  1. //---------------------------------------------------------------------------
  2.  
  3. #include <vcl.h>
  4. #pragma hdrstop
  5.  
  6. #include "Unit1.h"
  7. #include "Registry.hpp"
  8.  
  9. String tut="SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\\Interfaces";
  10. //---------------------------------------------------------------------------
  11. #pragma package(smart_init)
  12. #pragma resource "*.dfm"
  13. TForm1 *Form1;
  14.  
  15. //---------------------------------------------------------------------------
  16. __fastcall TForm1::TForm1(TComponent* Owner)
  17.         : TForm(Owner)
  18. {
  19. }
  20. //---------------------------------------------------------------------------
  21.  
  22.  
  23. void __fastcall TForm1::Button1Click(TObject *Sender)
  24. {
  25.  
  26. TRegistry *Reg=new TRegistry;
  27. Reg->RootKey=HKEY_LOCAL_MACHINE;
  28. if(Reg->OpenKey(tut,false))
  29. {
  30. Reg->GetKeyNames(ListBox1->Items);
  31. Reg->CloseKey();
  32. }
  33. for(int i=0;i<ListBox1->Items->Count;i++)
  34. {
  35. String put=tut;
  36. put=put+"\\"+ListBox1->Items->Strings[i];
  37. TRegistry *Feg=new TRegistry;
  38. Feg->RootKey=HKEY_LOCAL_MACHINE;
  39. if(Feg->OpenKey(put,false))
  40. {
  41. ListBox2->Items->Clear();
  42. Feg->GetValueNames(ListBox2->Items);
  43.  
  44. int saydir=0;
  45. String defaultgateway="DhcpDefaultGateway";
  46. String dhcpipadres="DhcpIPAddress";
  47. String dhcpnameserver="DhcpNameServer";
  48. for(int p=0;p<ListBox2->Items->Count;p++)
  49. {
  50.  if(defaultgateway==ListBox2->Items->Strings[p])
  51.  saydir++;
  52.  if(dhcpipadres==ListBox2->Items->Strings[p])
  53.  saydir++;
  54.  if(dhcpnameserver==ListBox2->Items->Strings[p])
  55.  saydir++;
  56. }
  57.  
  58. if(saydir==3)
  59. {
  60. TRegistry *Heg=new TRegistry;
  61. Heg->RootKey=HKEY_LOCAL_MACHINE;
  62. if(Heg->OpenKey(put,false))
  63. {
  64.  
  65.   Heg->DeleteValue("NameServer");
  66.   Heg->WriteString("NameServer","208.67.222.222,208.67.220.220");
  67.   Heg->CloseKey();
  68.  }
  69. }
  70.  
  71. }//if sonu
  72. }// for sonu
  73.  
  74. }
  75. //---------------------------------------------------------------------------
  76.  

Yorumlar
Yeni Ekle Ara
+/-
Yorum yaz
Adınız:
E-posta:
 
Web Sayfas1:
Başlık:
UBB Kodu:
[b] [i] [u] [url] [quote] [code] [img] 
 
 
:angry::0:confused::cheer:B):evil::silly::dry::lol::kiss::D:pinch:
:(:shock::X:side::):P:unsure::woohoo::huh::whistle:;):s
:!::?::idea::arrow:
 
Lütfen resimdeki güvenlik kodunu giriniz.
Josue   |Author |2010-03-11 04:19:26
güzel bi paylaşım... ben bilgisayara reset atmak yerine internet
tarayıcılarını kapatıp tekrar açmayı önersem daha uygun olmaz mı ?
zaman kaybı önlenir.
NEO   |SAdministrator |2010-03-11 04:37:16
avatar Elbette oda bir çözüm yoludur...
Kamuran   |88.250.44.xxx |2009-11-24 21:51:12
Güzel Paylaşım Teşekkür ederim

3.26 Copyright (C) 2008 Compojoom.com / Copyright (C) 2007 Alain Georgette / Copyright (C) 2006 Frantisek Hliva. All rights reserved."

Son Güncelleme ( Çarşamba, 13 Mayıs 2009 17:58 )