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 


[HELP] OpenFileDialog at C#

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Stylo
Grandmaster Cheater Supreme
Reputation: 3

Joined: 16 May 2007
Posts: 1073
Location: Israel

PostPosted: Wed Feb 27, 2008 11:06 am    Post subject: [HELP] OpenFileDialog at C# Reply with quote

i have made a button that open the openfiledialog and when i choose a file i want that the file's directory will be saved in some String... how can i do it ?
_________________
Stylo
Back to top
View user's profile Send private message
GuM
Expert Cheater
Reputation: 0

Joined: 17 Jan 2007
Posts: 185
Location: The Netherlands

PostPosted: Wed Feb 27, 2008 12:19 pm    Post subject: Reply with quote

I don't know C#, so not sure how I can do it in C#, but here's an example of how you can do that in Delphi. I'm sure you can convert that to C#.

Code:
var
  saveDialog : TSaveDialog;    // Save dialog variable
  LolString: String;
begin
  saveDialog := TSaveDialog.Create(self); //Create Save dialog
//blabla
  saveDialog.Execute; //Open Save Dialog
  LolString := SaveDialog.FileName; //Save chosen filename in a string
  saveDialog.Free;
end;


That's save dialog, but I'm pretty sure that open dialog is almost the same.
Back to top
View user's profile Send private message
Stylo
Grandmaster Cheater Supreme
Reputation: 3

Joined: 16 May 2007
Posts: 1073
Location: Israel

PostPosted: Wed Feb 27, 2008 12:59 pm    Post subject: Reply with quote

nvm i got this working few minutes ago but thanks any way..
btw i have another problem...
how can i get the location of some Folder / Directory in my computer into a string variable?

_________________
Stylo
Back to top
View user's profile Send private message
lurc
Grandmaster Cheater Supreme
Reputation: 2

Joined: 13 Nov 2006
Posts: 1900

PostPosted: Wed Feb 27, 2008 2:36 pm    Post subject: Reply with quote

System.IO.Directory.Exists
System.IO.Directory.GetDirectories
System.IO.Directory.GetDirectoryRoot
System.IO.Directory.GetCurrentDirectory

just look around in System.IO

i use this program to simply move my bot dll, and rename it to PCOMDebug.dll at MapleStory's directory... cuz im that lazy Razz

Code:
        static void Main(string[] args)
        {
            if ( System.IO.File.Exists( "C:\\Program Files\\Nexon\\MapleStory\\PCOMDebug.dll" ) )
                System.IO.File.Delete( "C:\\Program Files\\Nexon\\MapleStory\\PCOMDebug.dll" );
            System.IO.File.Copy("C:\\Documents and Settings\\Kyle\\My Documents\\Visual Studio 2008\\Projects\\lBot v2\\Release\\lBot Win32 DLL.dll",
                "C:\\Program Files\\Nexon\\MapleStory\\PCOMDebug.dll");
            System.Console.WriteLine("File Moved and Renamed... Exiting Now");
            System.Threading.Thread.Sleep(1000);
        }

_________________
Back to top
View user's profile Send private message
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Wed Feb 27, 2008 2:55 pm    Post subject: Reply with quote

Look at the methods, there's stuff to get the current directory, etc.
Back to top
View user's profile Send private message
samuri25404
Grandmaster Cheater
Reputation: 7

Joined: 04 May 2007
Posts: 955
Location: Why do you care?

PostPosted: Wed Feb 27, 2008 2:57 pm    Post subject: Reply with quote

lurc wrote:
System.IO.Directory.Exists
System.IO.Directory.GetDirectories
System.IO.Directory.GetDirectoryRoot
System.IO.Directory.GetCurrentDirectory

just look around in System.IO

i use this program to simply move my bot dll, and rename it to PCOMDebug.dll at MapleStory's directory... cuz im that lazy :P

Code:
        static void Main(string[] args)
        {
            if ( System.IO.File.Exists( "C:\\Program Files\\Nexon\\MapleStory\\PCOMDebug.dll" ) )
                System.IO.File.Delete( "C:\\Program Files\\Nexon\\MapleStory\\PCOMDebug.dll" );
            System.IO.File.Copy("C:\\Documents and Settings\\Kyle\\My Documents\\Visual Studio 2008\\Projects\\lBot v2\\Release\\lBot Win32 DLL.dll",
                "C:\\Program Files\\Nexon\\MapleStory\\PCOMDebug.dll");
            System.Console.WriteLine("File Moved and Renamed... Exiting Now");
            System.Threading.Thread.Sleep(1000);
        }


Good idea, Kyle!

_________________
Wiccaan wrote:

Oh jeez, watchout I'm a bias person! Locked.


Auto Assembly Tuts:
In Depth Tutorial on AA
Extended
Back to top
View user's profile Send private message
Stylo
Grandmaster Cheater Supreme
Reputation: 3

Joined: 16 May 2007
Posts: 1073
Location: Israel

PostPosted: Wed Feb 27, 2008 10:35 pm    Post subject: Reply with quote

i think u got me wrong :\
i ment i want to get my application's location into a string.. how can i do that? Surprised

_________________
Stylo
Back to top
View user's profile Send private message
Pseudo Xero
I post too much
Reputation: 0

Joined: 16 Feb 2007
Posts: 2607

PostPosted: Wed Feb 27, 2008 10:38 pm    Post subject: Reply with quote

1qaz wrote:
i think u got me wrong :\
i ment i want to get my application's location into a string.. how can i do that? Surprised

System.IO.Directory.GetCurrentDirectory
Back to top
View user's profile Send private message
Stylo
Grandmaster Cheater Supreme
Reputation: 3

Joined: 16 May 2007
Posts: 1073
Location: Israel

PostPosted: Thu Feb 28, 2008 9:13 am    Post subject: Reply with quote

i got it working thx :]
_________________
Stylo
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