Advertisement
Wacharakiat

Untitled

Sep 13th, 2015
340
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. string invFile = "E:\\Inventory.dat";
  2.  
  3. StreamReader sr = new StreamReader(invFile);
  4.  
  5. string text = "";
  6.  
  7. string[] data;
  8.  
  9. int i = 0;
  10.  
  11. while (sr.Peek() >= 0)
  12. {
  13.  
  14. text = sr.ReadLine();
  15. data = text.Split('/');
  16.  
  17. Line();
  18. Console.WriteLine("No.\tName\tPrice\tStock\tPriceStock");
  19. Line();
  20. 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]));
  21.  
  22. Line();
  23.  
  24. i++;
  25.  
  26. }
  27.  
  28. Console.WriteLine("Total Price in Stock = {0:n} Baht");
  29.  
  30. Line();
  31.  
  32. sr.Close();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement