Click here to Skip to main content
15,909,953 members
Home / Discussions / C#
   

C#

 
GeneralRe: File transfer Pin
AB777110-Sep-06 18:23
AB777110-Sep-06 18:23 
Questionfolder and file difference Pin
chandler837-Sep-06 18:50
chandler837-Sep-06 18:50 
AnswerRe: folder and file difference Pin
mikone7-Sep-06 21:18
mikone7-Sep-06 21:18 
AnswerRe: folder and file difference Pin
Stefan Troschuetz7-Sep-06 21:48
Stefan Troschuetz7-Sep-06 21:48 
GeneralRe: folder and file difference Pin
chandler838-Sep-06 0:52
chandler838-Sep-06 0:52 
Questionhow to create a mobile application in C#? Pin
yousafzai7-Sep-06 18:04
yousafzai7-Sep-06 18:04 
AnswerRe: how to create a mobile application in C#? Pin
Nader Elshehabi7-Sep-06 18:19
Nader Elshehabi7-Sep-06 18:19 
GeneralRe: how to create a mobile application in C#? Pin
yousafzai7-Sep-06 18:24
yousafzai7-Sep-06 18:24 
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 

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.