Advertisement
Guest User

Untitled

a guest
Jan 19th, 2020
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. string[] txt = new string[2000];
  2. OpenFileDialog ofd = new OpenFileDialog();
  3. SaveFileDialog sfd = new SaveFileDialog();
  4. if (ofd.ShowDialog() == DialogResult.OK)
  5. {
  6. if (sfd.ShowDialog() == DialogResult.OK) ;
  7. {
  8. FileStream fs1 = new FileStream(ofd.FileName, FileMode.Open, FileAccess.Read, FileShare.Read);
  9. StreamReader sr = new StreamReader(fs1, Encoding.Default);
  10. FileStream fs2 = new FileStream(sfd.FileName, FileMode.Create, FileAccess.Write, FileShare.Write);
  11. StreamWriter sw = new StreamWriter(fs2, Encoding.Default);
  12.  
  13. int i = 0;
  14. string zeile;
  15. while ((zeile = sr.ReadLine()) != null)
  16. txt[i++] = zeile;
  17. while (i > 0)
  18. sw.WriteLine(txt[--i]);
  19. }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement