PColik Posted November 28, 2011 Share Posted November 28, 2011 arkadaşlar ben registry get.value ile registry den kayıt alıcam. checkbox 1 şu kodları yazdım; if CheckBox.GetChecked(this, true) then Registry.SetValue(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows\\CurrentVersion\\Run","Kolay_Ara.exe",_SourceFolder.."\\".._SourceFilename, REG_SZ) else Registry.DeleteValue(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows\\CurrentVersion\\Run", "Kolay_Ara.exe") end diyelim bu kodlara göre bilgisayar yeniden başlayınca Kolay_Ara.exe çalışıyor ama programı tekrar açtığımda eğer Kolay_Ara.exe başlangıçta varsa checkbox seçilmiş olucak. çünkü normalde pc yeniden başlayınca checkbox lar felan hep ilk halini alıyor. şu kodla; result = Registry.GetValue(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows\\CurrentVersion\\Run", "Kolay_Ara.exe", true); eğer registry'nin yukarıda verdiğim kısmında Kolay_Ara.exe varsa CheckBox1 seçilmiş olacak, yoksa seçilmiş olmayacak. yardım edebilirmisiniz? Quote Link to comment Share on other sites More sharing options...
pilgetir Posted November 28, 2011 Share Posted November 28, 2011 Biraz daha açarsan yardımcı olabilirim. Quote Link to comment Share on other sites More sharing options...
PColik Posted November 28, 2011 Author Share Posted November 28, 2011 [size="2"]Regedit/[font=verdana, tahoma, sans-serif]HKEY_LOCAL_MACHINE/Software/Microsoft/Windows/CurrentVersion/Run[/font][/size] [size="2"][font=verdana, tahoma, sans-serif] [/font][/size] [size="2"][font=verdana, tahoma, sans-serif]yukarıdaki yolda windows başlangıcında çalışan dosyalar var. örneğin RTHDCPL.exe, NvCplDaemon.exe vs.[/font][/size] [font="verdana, tahoma, sans-serif"][size="2"]eğer yukarıdaki yolda Kolay_Ara.exe diye bir öğe var ise CheckBox1 seçilmiş olacak, eğer o yolda Kolay_Ara.exe diye bir dosya yok ise CheckBox1 seçili olmayacak[/size][/font] Quote Link to comment Share on other sites More sharing options...
pilgetir Posted November 28, 2011 Share Posted November 28, 2011 Ha şimdi oldu.Bunu bir dene ben çalışıyor mu denemedim. [quote] sKontrol = Registry.SetValue(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows\\CurrentVersion\\Run","Kolay_Ara.exe",_SourceFolder.."\ \".._SourceFilename, REG_SZ") if (sKontol) then CheckBox.SetChecked("CheckBox1", true); else CheckBox.SetChecked("CheckBox1", false); end[/quote] Quote Link to comment Share on other sites More sharing options...
PColik Posted November 28, 2011 Author Share Posted November 28, 2011 olmadı. aslında olduda şöyle oldu. senin verdiğin kodu on timer kısmına yazdım. on show kısmınıda Page.StartTimer(100, 1) yazdım. durum böyle oluncada checkbox1 i seçer seçmez hemen kapanıyor yine. Quote Link to comment Share on other sites More sharing options...
pilgetir Posted November 28, 2011 Share Posted November 28, 2011 Peki direk on showa koy bakalım? Quote Link to comment Share on other sites More sharing options...
PColik Posted November 28, 2011 Author Share Posted November 28, 2011 oraya koymayıda denedim. bu sefer hiç olmadı. Quote Link to comment Share on other sites More sharing options...
pilgetir Posted November 28, 2011 Share Posted November 28, 2011 birde böyle dener misin ? [quote]sKontrol = Registry.GetValue(HKEY_LOCAL_MACHINE/Software/Microsoft/Windows/CurrentVersion/Run/Kolay_Ara) if (sKontol) then CheckBox.SetChecked("CheckBox1", true); else CheckBox.SetChecked("CheckBox1", false); end[/quote] Quote Link to comment Share on other sites More sharing options...
PColik Posted November 28, 2011 Author Share Posted November 28, 2011 böylede olmadı. Quote Link to comment Share on other sites More sharing options...
NotToday Posted November 28, 2011 Share Posted November 28, 2011 (edited) [quote]Registry.GetValue(HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Run", "Kolay_Ara", true); error = Application.GetLastError(); StatusDlg.Hide(); if error == 0 then CheckBox.SetChecked("CheckBox1", true); else CheckBox.SetChecked("CheckBox1", false); end[/quote] Edited November 28, 2011 by ReaLyMaN Quote Link to comment Share on other sites More sharing options...
KintaRo Posted November 29, 2011 Share Posted November 29, 2011 [quote]Registry.GetValue() [/quote] değeri almak için kullanılır. Size öyle bir anahtarın olup olmadığını kontrol eden bir komut lazım: [quote]Registry.DoesKeyExist()[/quote] Bu komut eğer anahtar mevcut ise true, değilse false dönüşünü verecektir. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.