473,387 Members | 1,603 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,387 software developers and data experts.

Help for Godsake Help me!! How can we do Parsing of Hexdecimel in C# reading string

How can we do Parsing of Hexdecimel in C# reading string from stream file for eg..

i have a file like..........

0f 2f 12 2d 3a.......in hexa decimal save in a file.txt and i m reading it from the file.......

now i have to convert this in decimal and save in an array.of integers.......i thought it can be achieved through parsing ..means 0f could be stored in array converted in decimal...but remmber i m reading from a file///////////////i work 4 hours on it but could not do anything....any one plz help....plz help...............
Nov 5 '06 #1
1 1620
FileStream fs = File.OpenRead( FilePath );
StreamReader sr = new StreamReader( fs );
string sLine = sr.ReadLine();
while ( sLine != null )
{
string[] sArr = sLine.Split( ' ' );
int[] intArr = new int[ sArr.Length ];
int i = 0;
foreach ( string s in sArr )
{
byte x = Convert.ToByte( s, 16 );
intArr.SetValue( x, i );
i++;
}
foreach( int a in intArr )
MessageBox.Show( a.ToString() );
sLine = sr.ReadLine();
}
Nov 6 '06 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: bj0011 | last post by:
I am trying to parse an XML file obtained from a public WebService (see below). This file does not seem to be loading into a .NET XmlDocument right (I think it is because of all of the <Item Name=""...
6
by: dough | last post by:
Heres a snippet of my code. I am trying to dynamically allocate memory for reading in strings from a file. FILE *f; /* file to read */ char *s; ...
1
by: vighnesh | last post by:
Hi All I am dealing a project in ASP.NET in which I have to establish a connection to SQL Server 2000 database,where the database was located on a remote system. For this I have used...
3
by: agalkin | last post by:
Does anyone know any C/C++ source code for parsing CGI input string into name/value pairs? The only condition is not using any templates.
1
by: [ Nicola ] | last post by:
Using imap i must zap through emails in my email address, then saving part of the message (the main body that is). Question is, how am i supposed to read only the message's content, ignoring all...
4
by: dom_perron | last post by:
Hi, I am developing ActiveX in MFC which has to display a bitmap from a string XML who contains binary data. I have parsing my XML string to get the binary data. Now, I want to create the...
4
by: Academia | last post by:
My .chm file is an embedded resource so when I use it GetManifestResourceStream returns a Stream which I convert into a temp file. Then I try Help.ShowHelp(Me, tempFileFullPath,...
3
by: Daniel | last post by:
I have a list of strings, which I need to convert into tuples. If the string is not in python tuple format (i.e. "('one', 'two')", "("one", 'two')", etc.), then I can just make it a 1-tuple (i.e....
9
by: victory2006 | last post by:
I need help converting a list into a string ex/ i want to compare this, "110"(string) to this (list) to see if they are identical. So, how would you do this? convert the string into a list?...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.