Click here to Skip to main content
15,891,788 members
Home / Discussions / C#
   

C#

 
GeneralRe: AMATEUR PROGRAMMER NEEDS HELP WITH SERIALIZATION Pin
carbon_golem12-Jun-08 11:31
carbon_golem12-Jun-08 11:31 
Generali Pin
bigchump12-Jun-08 12:31
bigchump12-Jun-08 12:31 
GeneralRe: AMATEUR PROGRAMMER NEEDS HELP WITH SERIALIZATION Pin
bigchump12-Jun-08 12:53
bigchump12-Jun-08 12:53 
QuestionRe: AMATEUR PROGRAMMER NEEDS HELP WITH SERIALIZATION Pin
Michael Schubert12-Jun-08 20:47
Michael Schubert12-Jun-08 20:47 
GeneralRe: AMATEUR PROGRAMMER NEEDS HELP WITH SERIALIZATION Pin
#realJSOP12-Jun-08 10:52
mve#realJSOP12-Jun-08 10:52 
GeneralRe: AMATEUR PROGRAMMER NEEDS HELP WITH SERIALIZATION Pin
bigchump12-Jun-08 12:37
bigchump12-Jun-08 12:37 
AnswerRe: AMATEUR PROGRAMMER NEEDS HELP WITH SERIALIZATION Pin
Simon P Stevens12-Jun-08 22:01
Simon P Stevens12-Jun-08 22:01 
GeneralRe: AMATEUR PROGRAMMER NEEDS HELP WITH SERIALIZATION Pin
bigchump13-Jun-08 5:33
bigchump13-Jun-08 5:33 
Hi Simon!
Yes, the file size is at least 16x larger than it should be!
I am using binary serialization as far as I know.
I already tried using char arrays (like the original app) instead of strings.
That doesn't help at all.
Here's the start of the code that writes the first small class:
public void SerializeNow()
{
header c=new header();
Stream s=File.Open(@"C:\baduga\manure.tmp",FileMode.Append);
BinaryFormatter b=new BinaryFormatter();
FileStream hread=new FileStream(@"c:\baduga\races.txt",FileMode.Open); //read races.txt
StreamReader hread1=new StreamReader(hread);
string temp;
string[] t=new string[1435];
int a=0,x=0,y;
while((temp=hread1.ReadLine())!=null)
{
if(temp.StartsWith("JJGENDRACE"))
{
c.entries=a;
b.Serialize(s,c);
for(y=0;y<c.entries;y++)>
{
b.Serialize(s,h[y]);
}
a=x=0;
}
else
{
t[x]=temp;
if(t[x]=="") t[x]="0";
x++;
if(x==1435)
{
if(a==0)
{
c.track=t[0];
c.date=t[1];
c.race=t[2];
c.distance=int.Parse(t[5].Trim('-'));
c.distanceD=c.distance/220;
c.surface=t[6];
c.type=t[8];
c.sex=t[9];
c.formtype=t[10];
c.purse=int.Parse(t[11]);
c.purseD=c.purse/5000;
if(c.purseD>50) c.purseD=50;
c.claimprice=int.Parse(t[12]);
c.trackrecord=float.Parse(t[14]);
c.simulT=t[20];
c.simulR=t[21];
c.breed=t[22];
c.poly=t[24];
c.par2f=int.Parse(t[213]);
c.par4f=int.Parse(t[214]);
c.par6f=int.Parse(t[215]);
c.parspeed=int.Parse(t[216]);
c.parLf=int.Parse(t[217]);
}
GeneralRe: AMATEUR PROGRAMMER NEEDS HELP WITH SERIALIZATION Pin
Simon P Stevens15-Jun-08 23:34
Simon P Stevens15-Jun-08 23:34 
QuestionWebservice question Pin
johland12-Jun-08 5:42
johland12-Jun-08 5:42 
AnswerRe: Webservice question Pin
Christian Graus12-Jun-08 6:05
protectorChristian Graus12-Jun-08 6:05 
GeneralRe: Webservice question Pin
johland12-Jun-08 6:37
johland12-Jun-08 6:37 
GeneralRe: Webservice question Pin
Christian Graus12-Jun-08 6:40
protectorChristian Graus12-Jun-08 6:40 
AnswerRe: Webservice question Pin
Christian Graus12-Jun-08 6:36
protectorChristian Graus12-Jun-08 6:36 
GeneralRe: Webservice question Pin
johland12-Jun-08 7:09
johland12-Jun-08 7:09 
GeneralRe: Webservice question Pin
Christian Graus12-Jun-08 7:26
protectorChristian Graus12-Jun-08 7:26 
GeneralRe: Webservice question Pin
johland12-Jun-08 10:02
johland12-Jun-08 10:02 
QuestionHow to find some value in HashTable ? Pin
Yanshof12-Jun-08 5:08
Yanshof12-Jun-08 5:08 
AnswerRe: How to find some value in HashTable ? PinPopular
Christian Graus12-Jun-08 5:11
protectorChristian Graus12-Jun-08 5:11 
AnswerRe: How to find some value in HashTable ? Pin
Brady Kelly12-Jun-08 5:38
Brady Kelly12-Jun-08 5:38 
QuestionWrite to PDF file Pin
Verghese12-Jun-08 5:03
Verghese12-Jun-08 5:03 
AnswerRe: Write to PDF file Pin
Christian Graus12-Jun-08 5:10
protectorChristian Graus12-Jun-08 5:10 
QuestionTimeSpan beginners question Pin
NewToAspDotNet12-Jun-08 3:45
NewToAspDotNet12-Jun-08 3:45 
AnswerRe: TimeSpan beginners question Pin
Simon P Stevens12-Jun-08 3:57
Simon P Stevens12-Jun-08 3:57 
QuestionHow to Remove the Duplicate Key(Repeated data) in CSV or Excel file using C# . Pin
bruze12-Jun-08 2:38
bruze12-Jun-08 2:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.