views:

23

answers:

1

i'm developing application that is listening to the data coming to the pc and store it in a db when i'm trying to use any sniffing software it decode the data and i can read it... but in my code ...., it come in a format like that

1822262151622341817118815518211616121520941131921572041519912321413018224510453482062312258624219217426213385792952422362282081777270129716688629114817282188771708157542505055171418651781981425595109572128317191993018793431541418175198551682143218916536118562071014546919618158204181231187237183188160147127165111798312311810419822146114761993113815821216617541542372062129733198212250147199288115346102031191275215728146245198190171121209115149107193226253199151253205183146112072202559697791491441131572351381412278441552554817712614110121823714822712523618924690185291182071331471286244143181469018522814822821118012620321315924832238219115405615512392145202385512115735771691111055935782371281492476567165158924021493139815144225143762294713291762001113814720516216041120169912317914878167571392103510118386589521910621319622274158971538465206168139190127867123282255271781242497522124211517622131122113236255230254211206911242051832545515823012124925217318223920523316923122925514321122343602492471242........

i have tried to use this System.Text.Encoding.ASCII.GetString(tcpHeader.Data) and it's working just fine. but when i run it and wait for the data(it's in XML format) i got it in many packets that it's hard to reread it again... what should i do? do i have to collect the data from every packets then add it all to get the whole message? or is there is a library to do that in the .net

A: 

WHEN I DECODED IT it come like that

1 packet data:<
2 packet data:?xml versi
3 packet data:on="1.0"
4 packet data:encoding="UTF-8

and so the real data look like that

<?xml version="1.0" encoding="UTF-8"?><alarm><datetime>2010-07-18T11:14:22Z</datetime><textch><textchid>020</textchid></textch><rule>DIR-020</rule><text>020-DIR-Intersection3_Magles_TCS6</text></alarm>

what is the best way to get the data all together again.or the read it as one full file?

Ramah
WHEN I DECODED IT it come like that 1 packet data:< 2 packet data:?xml versi 3 packet data:on="1.0" 4 packet data:encoding="UTF-8 and so the real data look like that <?xml version="1.0" encoding="UTF-8"?><alarm><datetime>2010-07-18T11:14:22Z</datetime><textch><textchid>020</textchid></textch><rule>DIR-020</rule><text>020-DIR-Intersection3_Magles_TCS6</text></alarm> what is the best way to get the data all together again.or the read it as one full file?
Ramah