Click here to Skip to main content
15,901,001 members
Home / Discussions / C#
   

C#

 
AnswerRe: how to create a mobile application in C#? Pin
Not Active7-Sep-06 18:29
mentorNot Active7-Sep-06 18:29 
QuestionProblem With ListBox Horizontal Scrollbar Pin
Aslam Bari7-Sep-06 17:30
Aslam Bari7-Sep-06 17:30 
AnswerRe: Problem With ListBox Horizontal Scrollbar Pin
Nader Elshehabi7-Sep-06 18:14
Nader Elshehabi7-Sep-06 18:14 
AnswerRe: Problem With ListBox Horizontal Scrollbar Pin
Aslam Bari8-Sep-06 20:21
Aslam Bari8-Sep-06 20:21 
QuestionRegistry Scan Pin
oskardiazdeleon7-Sep-06 16:45
oskardiazdeleon7-Sep-06 16:45 
AnswerRe: Registry Scan Pin
Nader Elshehabi7-Sep-06 18:00
Nader Elshehabi7-Sep-06 18:00 
GeneralRe: Registry Scan Pin
oskardiazdeleon8-Sep-06 10:07
oskardiazdeleon8-Sep-06 10:07 
GeneralRe: Registry Scan Pin
Nader Elshehabi8-Sep-06 13:11
Nader Elshehabi8-Sep-06 13:11 
Hello

Not a while loop. Here is a sample code of how to go through all keys in the registry using foreach loops and recursive function calling:

private void ScanRegistry()
    {
        RegistryKey Key;
        //Do somehting with the main 5 keys
        foreach (string subkey in Registry.ClassesRoot.GetSubKeyNames())
        {
            Key = Registry.ClassesRoot.OpenSubKey(subkey);
            MessageBox.Show(Key.Name);
            //Do somehting with the key
            ScanKey(Key);
        }
        foreach (string subkey in Registry.CurrentConfig.GetSubKeyNames())
        {
            Key = Registry.ClassesRoot.OpenSubKey(subkey);
            MessageBox.Show(Key.Name);
            //Do somehting with the key
            ScanKey(Key);
        }
        foreach (string subkey in Registry.CurrentUser.GetSubKeyNames())
        {
            Key = Registry.ClassesRoot.OpenSubKey(subkey);
            MessageBox.Show(Key.Name);
            //Do somehting with the key
            ScanKey(Key);
        }
        foreach (string subkey in Registry.DynData.GetSubKeyNames())
        {
            Key = Registry.ClassesRoot.OpenSubKey(subkey);
            MessageBox.Show(Key.Name);
            //Do somehting with the key
            ScanKey(Key);
        }
        foreach (string subkey in Registry.LocalMachine.GetSubKeyNames())
        {
            Key = Registry.ClassesRoot.OpenSubKey(subkey);
            MessageBox.Show(Key.Name);
            //Do somehting with the key
            ScanKey(Key);
        }
        foreach (string subkey in Registry.PerformanceData.GetSubKeyNames())
        {
            Key = Registry.ClassesRoot.OpenSubKey(subkey);
            MessageBox.Show(Key.Name);
            //Do somehting with the key
            ScanKey(Key);
        }
        foreach (string subkey in Registry.Users.GetSubKeyNames())
        {
            Key = Registry.ClassesRoot.OpenSubKey(subkey);
            MessageBox.Show(Key.Name);
            //Do somehting with the key
            ScanKey(Key);
        }
    }

    private void ScanKey(RegistryKey Key)
    {
        //Do somehting with the key
        RegistryKey subKey;
        foreach (string subkeyname in Key.GetSubKeyNames())
        {
            subKey = Key.OpenSubKey(subkeyname);
            MessageBox.Show(subKey.Name);
            ScanKey(subKey);
        }
    }




RegardsRose | [Rose]

Questionhow to export summaries? Pin
michal.kreslik7-Sep-06 16:25
michal.kreslik7-Sep-06 16:25 
AnswerRe: how to export summaries? Pin
Nader Elshehabi7-Sep-06 18:03
Nader Elshehabi7-Sep-06 18:03 
QuestionStoring multi data in a row Pin
Glen Harvy7-Sep-06 15:19
Glen Harvy7-Sep-06 15:19 
AnswerRe: Storing multi data in a row Pin
Nader Elshehabi7-Sep-06 18:26
Nader Elshehabi7-Sep-06 18:26 
AnswerRe: Storing multi data in a row Pin
Guffa7-Sep-06 19:05
Guffa7-Sep-06 19:05 
QuestionMS Exit Program Icon Pin
Glen Harvy7-Sep-06 14:30
Glen Harvy7-Sep-06 14:30 
AnswerRe: MS Exit Program Icon Pin
Insincere Dave7-Sep-06 14:55
Insincere Dave7-Sep-06 14:55 
GeneralRe: MS Exit Program Icon Pin
Glen Harvy7-Sep-06 15:44
Glen Harvy7-Sep-06 15:44 
QuestionADS Pin
HahnTech7-Sep-06 13:19
HahnTech7-Sep-06 13:19 
QuestionC# form caption Pin
Chris_McGrath7-Sep-06 13:11
Chris_McGrath7-Sep-06 13:11 
AnswerRe: C# form caption Pin
Bhupi Bhai7-Sep-06 23:44
Bhupi Bhai7-Sep-06 23:44 
GeneralRe: C# form caption Pin
Chris_McGrath11-Sep-06 13:42
Chris_McGrath11-Sep-06 13:42 
Questionread files from folder Pin
btota7-Sep-06 10:30
btota7-Sep-06 10:30 
AnswerRe: read files from folder Pin
Stefan Troschuetz7-Sep-06 10:35
Stefan Troschuetz7-Sep-06 10:35 
AnswerRe: read files from folder Pin
Aaron Dilliard7-Sep-06 10:54
Aaron Dilliard7-Sep-06 10:54 
AnswerRe: read files from folder Pin
chandler837-Sep-06 18:57
chandler837-Sep-06 18:57 
QuestionDatabase C# Pin
Nicostancila7-Sep-06 9:53
Nicostancila7-Sep-06 9:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.