Guest User

Untitled

a guest
Jul 19th, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. static string ArquivoVendaIni = "C:\SAT\VENDA.INI";
  2. static string ArquivoEntrada = @"C:SATENT.TXT";
  3.  
  4. static StreamReader srv = new StreamReader(ArquivoVendaIni);
  5. static StreamWriter swe = new StreamWriter(ArquivoEntrada, true);
  6.  
  7. public LeituraArquivo()
  8. {
  9. InitializeComponent();
  10. }
  11.  
  12. private void LeituraArquivo_Load(object sender, EventArgs e)
  13. {
  14. LerArquivo();
  15. }
  16.  
  17. public static void LerArquivo()
  18. {
  19. if (File.Exists(ArquivoVendaIni))
  20. {
  21. try
  22. {
  23. while ((linha = srv.ReadLine()) != null)
  24. {
  25. //VerQualEmpresa();
  26.  
  27. GravarArquivo();
  28. }
  29.  
  30. swe.Close();
  31. }
  32. catch (Exception ex)
  33. {
  34. //MessageBox.Show(ex.Message);
  35. }
  36. }
  37. else
  38. {
  39. //MessageBox.Show(" O arquivo " + arquivo + " não foi localizado");
  40. }
  41. }
  42.  
  43. private static void GravarArquivo()
  44. {
  45. swe.WriteLine(linha);
  46. }
  47. }
Add Comment
Please, Sign In to add comment