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
Sebastian Harko
NA
4
0
Reading a file byte by byte
May 4 2007 1:35 PM
Hello everyone,
I'm trying to do an hex editor in C#. My plan is to read a file byte by byte and display the byte in a text box.
I have the code bellow but it works very slow. Does anyone know why it works so slow ??
///
<summary>
///
Opens a file chooser.
///
</summary>
///
private
void
openToolStripMenuItem_Click(
object
sender,
EventArgs
e)
{
openFileDialog.ShowDialog();
string
fileName = openFileDialog.FileName;
FileStream
fileReader =
new
FileStream
(fileName,
FileMode
.Open,
FileAccess
.Read);
long
length = fileReader.Length;
long
position = 0;
while
(position < length){
position++;
textBox.Text += fileReader.ReadByte() +
" "
;
}
}
Best regards
Reply
Answers (
1
)
Absorbing Web Services
New and not sure what wrong here