473,698 Members | 2,556 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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::Rea d);
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::Sho w( S"Error opening specified file!", S"File Conversion
Error");
}
Nov 17 '05 #1
0 1084

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

Similar topics

11
461
by: Peter | last post by:
Hi how can I compare two byte arrays in VB.NET Thank Peter
3
7161
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
3056
id3
by: Bart Verdonck | last post by:
How can I extract the id3-tag from an mp3 file? Greetz, BV
2
2355
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 ParseFile(string fileName) { byte data; if (File.Exists(fileName)) {
2
2089
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 string. Here is a code snippet: Dim fs As New FileStream("c:\test.bin", FileMode.Open) Dim br As New BinaryReader(fs) Dim str As String
18
9062
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 database. The files are written by a late 1980's PC Pascal programme, for which I don't have the source code. I've managed to reverse engineer the file format. The strings are stored as Ascii in the file, with the first byte indicating the string...
2
2313
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. While reading characters from the stream, I came across a problem. The problem is "ProtéGé" . This is a persons name in one of the fields, and when reading characters, it basically skips the e's and grabs 2 bytes from the next field. Which throws...
7
1731
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 the descriptor or pointer to the array to the function
11
1416
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, and store it in 3 variables hr, min, sec then add the current session time to get teh new total time . i was trying to use StreamReader and the compiler is visual c++ 2003 a sample of the first line in the log file is below:
4
2671
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 Integer aa2 As Integer aa3 As Integer aa4 As Integer
0
8683
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8609
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9031
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8901
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8871
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7739
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4371
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4622
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3052
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.