Click here to Skip to main content
15,921,452 members
Home / Discussions / C#
   

C#

 
AnswerRe: Call User Control load event... Pin
russellsoft7-Apr-06 11:09
russellsoft7-Apr-06 11:09 
GeneralRe: Call User Control load event... Pin
Kasic Slobodan9-Apr-06 7:24
Kasic Slobodan9-Apr-06 7:24 
QuestionDetecting if a printer is connected using C# Pin
jzelma7-Apr-06 6:21
jzelma7-Apr-06 6:21 
AnswerRe: Detecting if a printer is connected using C# Pin
Braulio Dez7-Apr-06 10:07
Braulio Dez7-Apr-06 10:07 
QuestionHow to avoid displaying the Printer setting dialog when printing from Crystal Report Pin
jzelma7-Apr-06 6:15
jzelma7-Apr-06 6:15 
QuestionSMS for PDA Pin
sedso7-Apr-06 5:52
sedso7-Apr-06 5:52 
QuestionList of .NET Framwork versions installed. Pin
T John7-Apr-06 5:46
T John7-Apr-06 5:46 
AnswerRe: List of .NET Framwork versions installed. Pin
Eric Dahlvang7-Apr-06 6:52
Eric Dahlvang7-Apr-06 6:52 
The following will add the SDK versions to a combo box named cboSDK and the Framework versions to cboFramework.

<br />
using Microsoft.Win32;<br />
<br />
//call to method<br />
GetRegValues("SOFTWARE\\Microsoft\\.NETFramework");<br />
<br />
<pre><br />
        private Boolean GetRegValues(string cregPath)<br />
        {<br />
            RegistryKey rkeyMachine = Registry.LocalMachine;<br />
            RegistryKey rkeySub = rkeyMachine.OpenSubKey(cregPath, RegistryKeyPermissionCheck.ReadSubTree);<br />
            if (rkeySub == null)<br />
            {<br />
                MessageBox.Show("The registry key " + cregPath + " could not be opened.", "Registry Problem");<br />
                return false;<br />
            }<br />
            else<br />
            {<br />
                string cValue = "";<br />
                try<br />
                {<br />
                    string cLeftValue = "sdkInstallRootv";<br />
                    foreach (string cvalueName in rkeySub.GetValueNames())<br />
                    {<br />
                        //Only add to the combo if it is an sdkInstallRootvx.x value<br />
                        if (cvalueName.StartsWith(cLeftValue))<br />
                        {<br />
                            cValue = rkeySub.GetValue(cvalueName).ToString();<br />
                            if (cValue != string.Empty)<br />
                            {<br />
                                cboSDK.Items.Add(cvalueName.Replace(cLeftValue, "Version ") + " - " + cValue);<br />
                            }<br />
                        }<br />
                        else<br />
                        {<br />
                            //Check if this value is "InstallRoot" <br />
                            if (cvalueName == "InstallRoot")<br />
                            {<br />
                                cValue = rkeySub.GetValue(cvalueName).ToString();<br />
                                if (cValue != string.Empty)<br />
                                {<br />
                                    string[] cDirectories = System.IO.Directory.GetDirectories(cValue);<br />
<br />
                                    foreach (string cDir in cDirectories)<br />
                                    {<br />
                                        //now check subdirectories in the install root for MSIL assembler that ships with the .NET Framework Redistributable<br />
                                        if (System.IO.File.Exists(cDir + "\\ilasm.exe"))<br />
                                            cboFramework.Items.Add(cDir);<br />
                                    }<br />
                                }<br />
<br />
                            }<br />
                        }<br />
                    }<br />
                }<br />
                catch (Exception ex)<br />
                {<br />
                    MessageBox.Show(ex.ToString(), "Error");<br />
                    return false;<br />
                }<br />
                finally<br />
                {<br />
                    if (rkeySub != null)<br />
                    { rkeySub.Close(); }<br />
<br />
                }<br />
            }<br />
            return true;<br />
        }


----------
There go my people. I must find out where they are going so I can lead them.
- Alexander Ledru-Rollin

QuestionSqlException, but now SQL problem Pin
eggsovereasy7-Apr-06 5:18
eggsovereasy7-Apr-06 5:18 
AnswerRe: SqlException, but now SQL problem Pin
Guffa7-Apr-06 8:39
Guffa7-Apr-06 8:39 
GeneralRe: SqlException, but now SQL problem Pin
eggsovereasy7-Apr-06 10:37
eggsovereasy7-Apr-06 10:37 
QuestionWMEncoder Voice Level Detection Pin
Shajeel7-Apr-06 3:30
Shajeel7-Apr-06 3:30 
QuestionTree Control - Paged/On Demand population Pin
AJ1237-Apr-06 3:01
AJ1237-Apr-06 3:01 
AnswerRe: Tree Control - Paged/On Demand population Pin
Josh Smith7-Apr-06 3:55
Josh Smith7-Apr-06 3:55 
QuestionWhats wrong with this? Pin
livez7-Apr-06 2:19
livez7-Apr-06 2:19 
AnswerRe: Whats wrong with this? Pin
Colin Angus Mackay7-Apr-06 2:25
Colin Angus Mackay7-Apr-06 2:25 
GeneralRe: Whats wrong with this? Pin
livez7-Apr-06 2:28
livez7-Apr-06 2:28 
GeneralRe: Whats wrong with this? Pin
Jon Hulatt7-Apr-06 3:17
Jon Hulatt7-Apr-06 3:17 
GeneralRe: Whats wrong with this? Pin
livez7-Apr-06 3:25
livez7-Apr-06 3:25 
GeneralRe: Whats wrong with this? Pin
Guffa7-Apr-06 2:45
Guffa7-Apr-06 2:45 
GeneralRe: Whats wrong with this? Pin
livez7-Apr-06 3:04
livez7-Apr-06 3:04 
GeneralRe: Whats wrong with this? Pin
Jon Hulatt7-Apr-06 3:28
Jon Hulatt7-Apr-06 3:28 
GeneralRe: Whats wrong with this? Pin
livez7-Apr-06 3:49
livez7-Apr-06 3:49 
AnswerRe: Whats wrong with this? Pin
Judah Gabriel Himango7-Apr-06 4:05
sponsorJudah Gabriel Himango7-Apr-06 4:05 
QuestionC# and MS Word? Pin
kbalias7-Apr-06 1:59
kbalias7-Apr-06 1:59 

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.