Click here to Skip to main content
15,886,919 members
Home / Discussions / C#
   

C#

 
GeneralRe: CallContext SerializationException Pin
Skynyrd12-Dec-04 9:52
Skynyrd12-Dec-04 9:52 
GeneralVersion information Pin
Einar Kvandahl10-Dec-04 11:25
Einar Kvandahl10-Dec-04 11:25 
GeneralRe: Version information Pin
Robin Panther10-Dec-04 12:00
Robin Panther10-Dec-04 12:00 
GeneralRe: Version information Pin
Heath Stewart10-Dec-04 12:36
protectorHeath Stewart10-Dec-04 12:36 
GeneralCompilation error CS0006 Pin
thepersonof10-Dec-04 9:00
thepersonof10-Dec-04 9:00 
GeneralRe: Compilation error CS0006 Pin
Judah Gabriel Himango10-Dec-04 12:10
sponsorJudah Gabriel Himango10-Dec-04 12:10 
GeneralRe: Compilation error CS0006 Pin
thepersonof10-Dec-04 23:18
thepersonof10-Dec-04 23:18 
GeneralRe: Compilation error CS0006 Pin
thepersonof11-Dec-04 3:20
thepersonof11-Dec-04 3:20 
I'm pretty new to c# and I've managed to quickly write some code that works on my system to find the dir:

try<br />
            {<br />
                string curdir = Environment.GetEnvironmentVariable("windir") + "\\Microsoft.NET";<br />
               <br />
                DirectoryInfo dir = new DirectoryInfo(curdir);<br />
                if (Directory.Exists(curdir))<br />
                {<br />
                    System.IO.DirectoryInfo[] dirs = dir.GetDirectories();<br />
                    foreach (System.IO.DirectoryInfo fli in dirs)<br />
                    {<br />
                        if (fli.Name == "Managed DirectX")<br />
                        {<br />
                            curdir += "\\" + fli;<br />
                            break;<br />
                        }<br />
                    }<br />
                    dir = new DirectoryInfo(curdir);<br />
                    dirs = dir.GetDirectories();<br />
                    foreach (System.IO.DirectoryInfo fli in dirs)<br />
                    {<br />
                        if (fli.Name.StartsWith("v"))<br />
                        {<br />
                            curdir += "\\" + fli;<br />
                            break;<br />
                        }<br />
                    }<br />
                    MessageBox.Show(curdir);<br />
                }<br />
            }<br />
            catch<br />
            {<br />
                MessageBox.Show("Error finding directory");<br />
            }


How can this be improved?
Thanks
GeneralFrames in HTTPWebRequest Pin
JeromeKJerome10-Dec-04 7:08
JeromeKJerome10-Dec-04 7:08 
GeneralRe: Frames in HTTPWebRequest Pin
Heath Stewart10-Dec-04 12:41
protectorHeath Stewart10-Dec-04 12:41 
GeneralRe: Frames in HTTPWebRequest Pin
JeromeKJerome10-Dec-04 14:42
JeromeKJerome10-Dec-04 14:42 
GeneralRe: Frames in HTTPWebRequest Pin
Heath Stewart10-Dec-04 20:24
protectorHeath Stewart10-Dec-04 20:24 
GeneralRe: Frames in HTTPWebRequest Pin
JeromeKJerome11-Dec-04 2:24
JeromeKJerome11-Dec-04 2:24 
GeneralRe: Frames in HTTPWebRequest Pin
Dave Kreskowiak11-Dec-04 4:35
mveDave Kreskowiak11-Dec-04 4:35 
GeneralRe: Frames in HTTPWebRequest Pin
Heath Stewart11-Dec-04 21:51
protectorHeath Stewart11-Dec-04 21:51 
GeneralRe: Frames in HTTPWebRequest Pin
JeromeKJerome14-Dec-04 6:37
JeromeKJerome14-Dec-04 6:37 
GeneralHelp in Delimiter! Pin
ahjiefreak10-Dec-04 5:25
ahjiefreak10-Dec-04 5:25 
GeneralRe: Help in Delimiter! Pin
Alexander Kent10-Dec-04 17:00
Alexander Kent10-Dec-04 17:00 
GeneralHelp in Delimiter! Pin
ahjiefreak10-Dec-04 5:23
ahjiefreak10-Dec-04 5:23 
GeneralRe: Help in Delimiter! Pin
Alexander Kent10-Dec-04 17:00
Alexander Kent10-Dec-04 17:00 
GeneralRe: Help in Delimiter! Pin
ahjiefreak11-Dec-04 2:11
ahjiefreak11-Dec-04 2:11 
GeneralRe: Help in Delimiter! Pin
Alexander Kent11-Dec-04 13:28
Alexander Kent11-Dec-04 13:28 
GeneralRe: Help in Delimiter! Pin
ahjiefreak16-Dec-04 4:48
ahjiefreak16-Dec-04 4:48 
GeneralILDASM and Memory. Some confusion... Pin
...---...10-Dec-04 5:23
...---...10-Dec-04 5:23 
GeneralRe: ILDASM and Memory. Some confusion... Pin
leppie10-Dec-04 5:58
leppie10-Dec-04 5:58 

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.