Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


[C#] Search ".exe" Files from Mi Program

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Morph.C
Cheater
Reputation: 0

Joined: 15 Aug 2009
Posts: 29

PostPosted: Thu Sep 03, 2009 1:48 pm    Post subject: [C#] Search ".exe" Files from Mi Program Reply with quote

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. Embarassed
Back to top
View user's profile Send private message
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Thu Sep 03, 2009 2:24 pm    Post subject: Reply with quote

check out the DirectoryInfo class

http://msdn.microsoft.com/en-us/library/system.io.directoryinfo.aspx


Specifically these methods:
GetDirectories()
GetFiles()
Back to top
View user's profile Send private message
Morph.C
Cheater
Reputation: 0

Joined: 15 Aug 2009
Posts: 29

PostPosted: Mon Sep 07, 2009 10:44 am    Post subject: Reply with quote

slovach wrote:
check out the DirectoryInfo class

http://msdn.microsoft.com/en-us/library/system.io.directoryinfo.aspx


Specifically these methods:
GetDirectories()
GetFiles()


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!! Very Happy
Back to top
View user's profile Send private message
FullyAwesome
I post too much
Reputation: 0

Joined: 05 Apr 2007
Posts: 4438
Location: Land Down Under

PostPosted: Tue Sep 08, 2009 2:30 am    Post subject: Reply with quote

Morph.C wrote:
slovach wrote:
check out the DirectoryInfo class

http://msdn.microsoft.com/en-us/library/system.io.directoryinfo.aspx


Specifically these methods:
GetDirectories()
GetFiles()


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!! Very Happy


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
View user's profile Send private message MSN Messenger
Morph.C
Cheater
Reputation: 0

Joined: 15 Aug 2009
Posts: 29

PostPosted: Tue Sep 08, 2009 1:45 pm    Post subject: Reply with quote

FullyAwesome wrote:
Morph.C wrote:
slovach wrote:
check out the DirectoryInfo class

http://msdn.microsoft.com/en-us/library/system.io.directoryinfo.aspx


Specifically these methods:
GetDirectories()
GetFiles()


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!! Very Happy


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 Very Happy!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites