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#] File management

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

Joined: 20 Jan 2007
Posts: 245
Location: Stockholm, Sweden

PostPosted: Fri Feb 06, 2009 4:16 pm    Post subject: [C#] File management Reply with quote

Hi again, Im making an lightweight text/file editor.

My idea is simply open an .txt file, display it in editable view and be able to same that file.

I succeeded with making the open&save buttons but im really stuck on the text editing window:

What tool should i use for it? What code should it be behind it to work?
I search on google but haven't found eny sources/tutorials that fit my demands.

Regards,
Deve

_________________


Leecher.
Back to top
View user's profile Send private message MSN Messenger
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Fri Feb 06, 2009 11:38 pm    Post subject: Reply with quote

I doubt you'll do better than the RichTextEdit control outside of creating your own.
Back to top
View user's profile Send private message
NINTENDO
Grandmaster Cheater Supreme
Reputation: 0

Joined: 02 Nov 2007
Posts: 1371

PostPosted: Sat Feb 07, 2009 2:55 pm    Post subject: Re: [C#] File management Reply with quote

develito wrote:
Hi again, Im making an lightweight text/file editor.

My idea is simply open an .txt file, display it in editable view and be able to same that file.

I succeeded with making the open&save buttons but im really stuck on the text editing window:

What tool should i use for it? What code should it be behind it to work?
I search on google but haven't found eny sources/tutorials that fit my demands.

Regards,
Deve


Hi.

Normal textbox = plain text editing
Rich textbox = For when you need special formation on one or more paragraphs.

Easiest code to read from and write to files :
Code:

private void Loadbtn_Click(object sender, EventArgs e)
        {
            textBox1.Text = File.ReadAllText(@"C:\test.txt");
        }

private void Savebtn_Click(object sender, EventArgs e)
        {
            File.WriteAllText(@"C:\test.txt", textBox1.Text);
        }


Sometimes you might wanna read all the lines seperatly

Code:
           
foreach (string line in File.ReadAllLines(@"C:\test.txt"))
            {
                textBox1.Text += line;
            }


Futhermore you might wanna study streamreaders, streamwriters, filedialogs and later on rich textboxes.
Best of luck /wireen.

_________________
Intel over amd yes.
Back to top
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger MSN Messenger
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