Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- string invFile = "E:\\Inventory.dat";
- StreamReader sr = new StreamReader(invFile);
- string text = "";
- string[] data;
- int i = 0;
- while (sr.Peek() >= 0)
- {
- text = sr.ReadLine();
- data = text.Split('/');
- Line();
- Console.WriteLine("No.\tName\tPrice\tStock\tPriceStock");
- Line();
- Console.WriteLine("{0}\t{1,9}\t{2,9:f}\t{3,9}\t{4,9:n}", i, data[1], float.Parse(data[2]), float.Parse(data[3]), float.Parse(data[2]) * float.Parse(data[3]));
- Line();
- i++;
- }
- Console.WriteLine("Total Price in Stock = {0:n} Baht");
- Line();
- sr.Close();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement