View previous topic :: View next topic |
Author |
Message |
Morph.C Cheater
Reputation: 0
Joined: 15 Aug 2009 Posts: 29
|
Posted: Thu Sep 03, 2009 1:48 pm Post subject: [C#] Search ".exe" Files from Mi Program |
|
|
Hello, I have a problem I hope not to disturb them by being so "fast" or perhaps "rude" in some sense come to seek help as well.
It turns out I am making an application in C #, which looks for certain files on the user's PC, to find the show in a Combobox, making you highlight those files to run.
We can say that I'm using Windows Forms, and files that are displayed in the combobox are just the executables, I'll be looking for this file "Launcher.exe Nyx" among others but this is the one that makes me more urgently.
The program will also analyze how many records exist in the PC, if there are 2 or more to analyze all to find one or all of the programs with the names given above, I hope I have understood, at least someone can tell me which function to use for this?.
Thanks in advance!.
I hope not to be rude as I said earlier.
|
|
Back to top |
|
 |
hcavolsdsadgadsg I'm a spammer
Reputation: 26
Joined: 11 Jun 2007 Posts: 5801
|
|
Back to top |
|
 |
Morph.C Cheater
Reputation: 0
Joined: 15 Aug 2009 Posts: 29
|
Posted: Mon Sep 07, 2009 10:44 am Post subject: |
|
|
Thanks, i find this code:
Code: | using System.IO;
foreach (string sArc in Directory.GetFiles("C:\\", "*.exe", SearchOption.AllDirectories))
{
comboBox1.Items.Add(Path.GetFileName(sArc));
} |
The MDSN is so Good!!
|
|
Back to top |
|
 |
FullyAwesome I post too much
Reputation: 0
Joined: 05 Apr 2007 Posts: 4438 Location: Land Down Under
|
Posted: Tue Sep 08, 2009 2:30 am Post subject: |
|
|
Morph.C wrote: |
Thanks, i find this code:
Code: | using System.IO;
foreach (string sArc in Directory.GetFiles("C:\\", "*.exe", SearchOption.AllDirectories))
{
comboBox1.Items.Add(Path.GetFileName(sArc));
} |
The MDSN is so Good!!  |
you might want to use an environment variable for getting the users root drive, incase they don't use C:\. something like: %HOMEDRIVE%
_________________
|
|
Back to top |
|
 |
Morph.C Cheater
Reputation: 0
Joined: 15 Aug 2009 Posts: 29
|
Posted: Tue Sep 08, 2009 1:45 pm Post subject: |
|
|
FullyAwesome wrote: | Morph.C wrote: |
Thanks, i find this code:
Code: | using System.IO;
foreach (string sArc in Directory.GetFiles("C:\\", "*.exe", SearchOption.AllDirectories))
{
comboBox1.Items.Add(Path.GetFileName(sArc));
} |
The MDSN is so Good!!  |
you might want to use an environment variable for getting the users root drive, incase they don't use C:\. something like: %HOMEDRIVE% |
Oh thanks, very good now works better !
|
|
Back to top |
|
 |
|