Click here to Skip to main content
15,920,005 members
Home / Discussions / C#
   

C#

 
AnswerRe: GDI / FPS Question Pin
User 665825-Jun-08 5:19
User 665825-Jun-08 5:19 
GeneralRe: GDI / FPS Question Pin
Harvey Saayman25-Jun-08 7:48
Harvey Saayman25-Jun-08 7:48 
QuestionHow to count Startup Services and Processes using C# Pin
Neeraj Kr25-Jun-08 3:56
Neeraj Kr25-Jun-08 3:56 
AnswerRe: How to count Startup Services and Processes using C# Pin
Manas Bhardwaj25-Jun-08 5:11
professionalManas Bhardwaj25-Jun-08 5:11 
AnswerRe: How to count Startup Services and Processes using C# Pin
Neeraj Kr25-Jun-08 20:15
Neeraj Kr25-Jun-08 20:15 
GeneralRe: How to count Startup Services and Processes using C# Pin
Manas Bhardwaj25-Jun-08 22:40
professionalManas Bhardwaj25-Jun-08 22:40 
GeneralRe: How to count Startup Services and Processes using C# Pin
Neeraj Kr25-Jun-08 22:44
Neeraj Kr25-Jun-08 22:44 
AnswerRe: How to count Startup Services and Processes using C# Pin
Neeraj Kr25-Jun-08 22:40
Neeraj Kr25-Jun-08 22:40 
I created the following method for finding out the number of all the startup processes which is exclusive of the one in the HKLM\Software\Microsoft\CurrentVersion\Run. Here it goes.

public int getStartupProcessCount()
        {
            RegistryKey theKeyHKLM = Registry.LocalMachine.OpenSubKey(@"Software\\Microsoft\\Windows\\CurrentVersion\\Run");
            string[] theValueNamesOfKeyHKLM = theKeyHKLM.GetValueNames();
            RegistryKey theKeyHKCU = Registry.CurrentUser.OpenSubKey(@"Software\\Microsoft\\Windows\\CurrentVersion\\Run");
            string[] theValueNamesOfKeyHKCU = theKeyHKCU.GetValueNames();
            string val;
            string dName; 
            int indexVal;
            int countStartupProcessess;
            string[] allVal = new string[theValueNamesOfKeyHKCU.Length + theValueNamesOfKeyHKLM.Length];
            theValueNamesOfKeyHKLM.CopyTo(allVal, 0);
            theValueNamesOfKeyHKCU.CopyTo(allVal, theValueNamesOfKeyHKLM.Length);
            countStartupProcessess = allVal.Length;

            string[] directories = Directory.GetDirectories("C:\\Documents and Settings");
            foreach (string d in directories) 
	        {
                foreach(string d1 in Directory.GetDirectories(d))
                {
                    indexVal = d1.LastIndexOf("\\");
                    dName = d1.Substring(indexVal+1, d1.Length - (indexVal+1));
                    if (dName.ToUpper() == "START MENU")
                    {
                        foreach (string d2 in Directory.GetDirectories(d1))
                        {
                            foreach (string d3 in Directory.GetDirectories(d2))
                            {
                                indexVal = d3.LastIndexOf("\\");
                                dName = d3.Substring(indexVal + 1, d3.Length - (indexVal + 1));
                                if (dName.ToUpper().Trim() == "STARTUP")
                                {
                                    foreach (string f in Directory.GetFiles(d3))
                                    {
                                        indexVal = f.LastIndexOf(".");
                                        dName = f.Substring(indexVal + 1, f.Length - (indexVal + 1));
                                        if (dName.ToUpper() == "LNK" && dName.ToUpper() != "INI")
                                            countStartupProcessess++;
                                    }
                                }
                            }
                        }
                    }
                }
	        }

            return countStartupProcessess;

        }


-----Have A Nice Day-----

Question[Message Deleted] Pin
mabby21625-Jun-08 3:05
mabby21625-Jun-08 3:05 
AnswerRe: Write entries to a text file--Need Help!! Pin
Ashfield25-Jun-08 3:17
Ashfield25-Jun-08 3:17 
GeneralRe: Write entries to a text file--Need Help!! Pin
mabby21625-Jun-08 3:27
mabby21625-Jun-08 3:27 
GeneralRe: Write entries to a text file--Need Help!! Pin
leppie25-Jun-08 3:29
leppie25-Jun-08 3:29 
GeneralRe: Write entries to a text file--Need Help!! Pin
mabby21625-Jun-08 3:43
mabby21625-Jun-08 3:43 
GeneralRe: Write entries to a text file--Need Help!! Pin
leppie25-Jun-08 3:52
leppie25-Jun-08 3:52 
GeneralRe: Write entries to a text file--Need Help!! Pin
Ashfield25-Jun-08 3:48
Ashfield25-Jun-08 3:48 
Questionftp connection c# Pin
laziale25-Jun-08 2:40
laziale25-Jun-08 2:40 
AnswerRe: ftp connection c# Pin
Abhijit Jana25-Jun-08 2:42
professionalAbhijit Jana25-Jun-08 2:42 
Questionhow to define coclass in c# com object? Pin
iman_kh25-Jun-08 2:38
iman_kh25-Jun-08 2:38 
AnswerRe: how to define coclass in c# com object? Pin
Mohammad Dayyan25-Jun-08 10:51
Mohammad Dayyan25-Jun-08 10:51 
Questionapp.config Pin
arkiboys25-Jun-08 2:32
arkiboys25-Jun-08 2:32 
AnswerRe: app.config Pin
SteveNY25-Jun-08 3:39
SteveNY25-Jun-08 3:39 
GeneralRe: app.config Pin
arkiboys25-Jun-08 3:46
arkiboys25-Jun-08 3:46 
GeneralRe: app.config Pin
Ashfield25-Jun-08 3:52
Ashfield25-Jun-08 3:52 
AnswerRe: app.config Pin
Marek Grzenkowicz25-Jun-08 3:46
Marek Grzenkowicz25-Jun-08 3:46 
QuestionHow Power Point slides picture can be tranfer to word document picture one by one. Pin
haroon_calculus25-Jun-08 1:52
haroon_calculus25-Jun-08 1:52 

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.