473,396 Members | 1,879 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

binaryreader->readchars

I'm reading chars from a file and displaying them in a label on a form.
Following is a listing of the code section. Could anyone tell me the best
way to do this? What I have works but wanted to know if there is a better
way. I had some trouble converting the binaryreader->readchars so that they
could be added to the label.

Thanks for your help.

Dave

String *sInput;
__wchar_t cTemp __gc[];
if ( File::Exists( txtFileName->Text->ToString() ) ){
FileStream *fStream = new FileStream( txtFileName->Text,
FileMode::Open, FileAccess::Read);
BinaryReader *bReader = new BinaryReader( fStream );
fStream->Seek( 2403, IO::SeekOrigin::Begin );
cTemp = bReader->ReadChars( 64 );
sInput = new String( cTemp );
lblFileInfo->Text = sInput;
fStream->Close();
bReader->Close();
} else {
MessageBox::Show( S"Error opening specified file!", S"File Conversion
Error");
}
Nov 17 '05 #1
0 1056

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Peter | last post by:
Hi how can I compare two byte arrays in VB.NET Thank Peter
3
by: liljester | last post by:
Is there a way to tell this method how many bytes to read from the stream? the msdn documentation doesnt explain its usage very well... Any help would be much appreciated
4
id3
by: Bart Verdonck | last post by:
How can I extract the id3-tag from an mp3 file? Greetz, BV
2
by: dotnetchic | last post by:
I'm trying to parse a binary file to help me with some analysis...what I'd like to do is take a byte of data and display its ascii char value (37='%', 38='&', etc.). private void...
2
by: James Minns | last post by:
Hi, I have the following problem with my VB code: accented characters are being transformed into a cr-lf pair! I am reading a sequence of bytes from a binary file, one part of which is a text...
18
by: John | last post by:
Hi, I'm a beginner is using C# and .net. I have big legacy files that stores various values (ints, bytes, strings) and want to read them into a C# programme so that I can store them in a...
2
by: JimmyKoolPantz | last post by:
I came across a problem today and I'm not sure what my possible solutions are. The situation is I am am using a binary reader to read data from a filestream. The data source is a dbf file. ...
7
by: =?Utf-8?B?YmVyaWNr?= | last post by:
New to this, I used to pass an array like this function BytesToString(byref myarray() as byte, somethingelse as long) as long and m = BytesToString(fooBar(), bluenose) This would send...
11
by: niazdokrat | last post by:
hey i am trying to write a program that saves logs and i have basically 3 columns session time,total time and comments in that order what i want to do is read in the total time on the last line,...
4
by: knuckels23 | last post by:
Hi All, I have a Random access file which is written using VB 6.0. I need to read this file using C#. The record used in VB to write the Random access file is as follows Type AA aa1 As...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.