Last active
February 17, 2018 04:29
-
-
Save immengineer/5873f97b7f2fb52272db4a498a951e85 to your computer and use it in GitHub Desktop.
Revisions
-
immengineer revised this gist
Feb 17, 2018 . No changes.There are no files selected for viewing
-
immengineer created this gist
Feb 17, 2018 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,28 @@ public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { textBox1.Text = ""; try { using (var mmf = MemoryMappedFile.OpenExisting("Test")) using (var stream = mmf.CreateViewStream()) using (StreamReader sr = new StreamReader(stream)) { while (!sr.EndOfStream) { textBox1.Text = sr.ReadLine(); } } } catch (Exception ex) { MessageBox.Show(ex.Message); } } }