Guest User

Untitled

a guest
Jan 23rd, 2019
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. namespace Receive_infile
  2. {
  3. public partial class Form1 : Form
  4. {
  5. static string InfilePath = @"D:infile.txt";
  6. static StreamWriter outputFile = new StreamWriter(InfilePath, true, Encoding.ASCII, 131072)
  7.  
  8. public Form1()
  9. {
  10. InitializeComponent();
  11.  
  12. REAL.ReceiveData += Handler_Real; // Handler_Real method is called whenever new data arrives
  13. }
  14.  
  15.  
  16. private void Handler_Real(string type)
  17. {
  18. string data = REAL.GetFieldData();
  19.  
  20. outputFile.WriteLine(data); // new data is added to outputFile
  21. }
  22. }
  23. }
Add Comment
Please, Sign In to add comment