Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static string ArquivoVendaIni = "C:\SAT\VENDA.INI";
- static string ArquivoEntrada = @"C:SATENT.TXT";
- static StreamReader srv = new StreamReader(ArquivoVendaIni);
- static StreamWriter swe = new StreamWriter(ArquivoEntrada, true);
- public LeituraArquivo()
- {
- InitializeComponent();
- }
- private void LeituraArquivo_Load(object sender, EventArgs e)
- {
- LerArquivo();
- }
- public static void LerArquivo()
- {
- if (File.Exists(ArquivoVendaIni))
- {
- try
- {
- while ((linha = srv.ReadLine()) != null)
- {
- //VerQualEmpresa();
- GravarArquivo();
- }
- swe.Close();
- }
- catch (Exception ex)
- {
- //MessageBox.Show(ex.Message);
- }
- }
- else
- {
- //MessageBox.Show(" O arquivo " + arquivo + " não foi localizado");
- }
- }
- private static void GravarArquivo()
- {
- swe.WriteLine(linha);
- }
- }
Add Comment
Please, Sign In to add comment