using System; using System.Data; using System.IO; using System.Runtime.Serialization.Formatters.Binary; using System.Runtime.Serialization; public class CreateFile { static void Main() { BinaryFormatter reader = new BinaryFormatter(); FileStream input = new FileStream(@"C:\Users\huynhdt\Desktop\Ftp\SECURITY.DAT", FileMode.Open, FileAccess.Read); Security record1 = (Security)reader.Serialize(input); Console.WriteLine(record1.StockNo); Console.ReadLine(); } } [Serializable] public class Security { public int StockNo; public String StockSymbol; public String StockType; public double Ceiling; public double Floor; public double BigLotValue; public string SecurityName; public string SectorNo; public string Designated; public string Suspension; public string Delist; public string HaltResumeFlag; public string Split; public string Benefit; public string Meeting; public string Notice; public string ClientIDRequest; public Int32 CouponRate; public string IssueDate; public string MatureDate; public double AvrPrice; public Int32 ParValue; public string SDCFlag; public double PriorClosePrice; public string PriorCloseDate; public double ProjectOpen; public double OpenPrice; public double Last; public double LastVol; public double LastVal; public double Highest; public double Lowest; public double Totalshare; public double TotalValue; public double AccumulateDeal; public Int32 BigDeal; public double BigVol; public double BigVal; public Int32 OddDeal; public double OddVol; public double OddVal; public double Best1Bid; public double Best1BidVolume; public double Best2Bid; public double Best2BidVolume; public double Best3Bid; public double Best3BidVolume; public double Best1Offer; public double Best1OfferVolume; public double Best2Offer; public double Best2OfferVolume; public double Best3Offer; public double Best3OfferVolume; public Int32 BoardLost; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)