I've did this project to Create a Binary File and Writing in the Binary File:
using System;
using System.IO;
namespace binaryfiles
{
class Program
{
static void Main(string[] args)
{
string path = @"c:\pss\file1.bin";
FileStream fs = new FileStream(path, FileMode.CreateNew, FileAccess.Write);
BinaryWriter bw = new BinaryWriter(fs);
int nr, year;
string firstname, lastname;
nr = 1;
firstname = "Sisqo";
lastname = "Williams";
year = 2010;
bw.Write(nr);
bw.Write(firstname);
bw.Write(lastname);
bw.Write(year);
bw.Close();
fs.Close();
}
}
}
This code worked perfectly, But i'm havin some trouble with another exercise and that is:
Creating a binary File with these data on it:
1 Sisqo Williams 2010
2 Michael Jordan 2010
3 Curtis Jackson 2010
4 Tom Cruise 2010
and then Creating an app that can do:
1.Read The Data That i've mentioned before
(nr,name,lastname & year)
2.Edit those data So
(when i call number 2 it has to show up the name Michael Jordan 2010,
and than i can edit it and replace michael jackson with another name
for example Barack Obama 2011 ?
I hope i was Clear (sorry for my english)
Can Anyone help me with this problem

New Topic/Question
Reply




MultiQuote






|