TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
softairhk
NA
115
0
File Write Problem
Oct 14 2003 12:35 PM
Hello! What's wrong for my listed coding? I can create a file with the inputted file name, but how can I add sContent into my created file? Please give me reply asap. Thanks! //Save File private void btnSave_Click(object sender, System.EventArgs e) { string sCheck=txtFileName.Text; if(sCheck.Length !=0) { string strLog=txtFileName.Text; FileStream fw = new FileStream(strLog +"." + "dat" ,FileMode.CreateNew, FileAccess.Write); string sContent="How to add this message into the created file"; fw.Write(sContent); fw.Close(); MessageBox.Show("File Created and Written successfully!","Finished",MessageBoxButtons.OK,MessageBoxIcon.Information); } else { MessageBox.Show("File Name is empty, cannot save file!","Error",MessageBoxButtons.OK,MessageBoxIcon.Error); } }
Reply
Answers (
5
)
Looping through a binary file?
Scaling Graphics