Advertisement
Guest User

Untitled

a guest
Dec 6th, 2016
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.27 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.IO;
  7.  
  8. namespace DateAndMoney
  9. {
  10. class InputNode
  11. {
  12. DateTime dateTime;
  13. string dollarAmount;
  14. }
  15. class Program
  16. {
  17. public static void ReadFile(string filename)
  18. {
  19. InputNode inputNode = new InputNode();
  20. if (System.IO.File.Exists(filename))
  21. {
  22. var reader = new StreamReader(File.OpenRead(filename));
  23.  
  24. while (!reader.EndOfStream)
  25. {
  26. var input = reader.ReadLine();
  27. var values = input.Split(',');
  28. inputNode.dateTime = values[0];
  29. inputNode.dollarAmount = values[1];
  30.  
  31. }
  32. }
  33. }
  34.  
  35. static void Main(string[] args)
  36. {
  37. string filename;
  38. Console.WriteLine("enter path and file name of input file");
  39. filename = Console.ReadLine();
  40. ReadFile(filename);
  41. }
  42. }
  43. }
  44.  
  45. inputNode.dateTime = values[0];
  46. inputNode.dollarAmount = values[1];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement