예제 #1
0
        public void TestReadAnsi()
        {
            string fileName = @"C:\projects\irslayout\src\Tests\bin\test.dat";

            using (System.IO.Stream stream = (System.IO.Stream)(System.IO.File.Open(fileName, System.IO.FileMode.Open, System.IO.FileAccess.Read)))
            {
                FireStreamReader reader = new FireStreamReader(stream);
                FireRecord record = new MAG1101();
                do
                {
                    record = reader.Read(record);
                } while (record != null);
            }
        }
예제 #2
0
        public void TestWriteAnsi()
        {
            string fileName = @"C:\projects\irslayout\src\Tests\bin\test.dat";

            using (System.IO.Stream stream = (System.IO.Stream)(System.IO.File.Open(fileName, System.IO.FileMode.Create)))
            {
                MAG1101[] records = new MAG1101[]{
                    new MAG1101()
                };
                records[0].tcc = "18L18";
                records[0].phone = "443-310-8410";
                records[0].phoneExtension = "34884";
                FireStreamWriter writer = new FireStreamWriter(stream);
                writer.Write(records);
                writer.Flush();
                writer.Close();
            }
        }