diff --git a/Notepad/.vs/Notepad/v16/.suo b/Notepad/.vs/Notepad/v16/.suo index c079c95..8aaf2c5 100644 Binary files a/Notepad/.vs/Notepad/v16/.suo and b/Notepad/.vs/Notepad/v16/.suo differ diff --git a/Notepad/Notepad v2/Form1.cs b/Notepad/Notepad v2/Form1.cs index 3821064..366b5f8 100644 --- a/Notepad/Notepad v2/Form1.cs +++ b/Notepad/Notepad v2/Form1.cs @@ -13,7 +13,7 @@ namespace Notatnik { public partial class Form1 : Form { - public string filePath = "null"; + public string filePath = Path.GetTempPath() + "null.txt"; private string[] lines; private int printedLines; public Form1() @@ -30,6 +30,10 @@ namespace Notatnik kopiujToolStripMenuItem.Enabled = false; button8.Enabled = false; button9.Enabled = false; + + TextWriter textWriter = new StreamWriter(filePath); + textWriter.Write("null"); + textWriter.Close(); } #region Zmiany kolorów przycisków @@ -117,38 +121,38 @@ namespace Notatnik void newFile() { TextReader textReader = new StreamReader(filePath); - if (filePath != "null" && richTextBox1.Text == "") + if (filePath != Path.GetTempPath() + "null.txt" && richTextBox1.Text == "") { if (richTextBox1.Text == textReader.ReadToEnd()) { this.Text = "Bez tytułu - Notatnik"; richTextBox1.Text = ""; - filePath = "null"; + filePath = Path.GetTempPath() + "null.txt"; } else { if (MessageBox.Show("W tym pliku zostały wprowadzone zmiany. Czy chcesz je zapisać", "Notatnik", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes) { - if (filePath == "null") + if (filePath == Path.GetTempPath() + "null.txt") saveAsFile(); else saveFile(); this.Text = "Bez tytułu - Notatnik"; richTextBox1.Text = ""; - filePath = "null"; + filePath = Path.GetTempPath() + "null.txt"; } else { this.Text = "Bez tytułu - Notatnik"; richTextBox1.Text = ""; - filePath = "null"; + filePath = Path.GetTempPath() + "null.txt"; } } } else { this.Text = "Bez tytułu - Notatnik"; richTextBox1.Text = ""; - filePath = "null"; + filePath = Path.GetTempPath() + "null.txt"; } } @@ -228,7 +232,7 @@ namespace Notatnik private void button2_Click(object sender, EventArgs e) { openFile(); } private void button3_Click(object sender, EventArgs e) { - if (filePath == "null") + if (filePath == Path.GetTempPath() + "null.txt") saveAsFile(); else saveFile(); @@ -291,13 +295,13 @@ namespace Notatnik private void Form1_FormClosing(object sender, FormClosingEventArgs e) { TextReader textReader = new StreamReader(filePath); - if (filePath != "null" && richTextBox1.Text == "") + if (filePath != Path.GetTempPath() + "null.txt" && richTextBox1.Text == "") { if (richTextBox1.Text == textReader.ReadToEnd()) { if (MessageBox.Show("W tym pliku zostały wprowadzone zmiany. Czy chcesz je zapisać", "Notatnik", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes) { - if (filePath == "null") + if (filePath == Path.GetTempPath() + "null.txt") saveAsFile(); else saveFile(); diff --git a/Notepad/Notepad v2/bin/Release/Notatnik.exe b/Notepad/Notepad v2/bin/Release/Notatnik.exe index 91beffe..6d3354f 100644 Binary files a/Notepad/Notepad v2/bin/Release/Notatnik.exe and b/Notepad/Notepad v2/bin/Release/Notatnik.exe differ diff --git a/Notepad/Notepad v2/bin/Release/Notatnik.pdb b/Notepad/Notepad v2/bin/Release/Notatnik.pdb index 8a70bc5..db0af9c 100644 Binary files a/Notepad/Notepad v2/bin/Release/Notatnik.pdb and b/Notepad/Notepad v2/bin/Release/Notatnik.pdb differ diff --git a/Notepad/Notepad v2/obj/Debug/TempPE/Properties.Resources.Designer.cs.dll b/Notepad/Notepad v2/obj/Debug/TempPE/Properties.Resources.Designer.cs.dll index 7fb8fa3..1a10902 100644 Binary files a/Notepad/Notepad v2/obj/Debug/TempPE/Properties.Resources.Designer.cs.dll and b/Notepad/Notepad v2/obj/Debug/TempPE/Properties.Resources.Designer.cs.dll differ diff --git a/Notepad/Notepad v2/obj/Release/Notatnik.exe b/Notepad/Notepad v2/obj/Release/Notatnik.exe index 91beffe..6d3354f 100644 Binary files a/Notepad/Notepad v2/obj/Release/Notatnik.exe and b/Notepad/Notepad v2/obj/Release/Notatnik.exe differ diff --git a/Notepad/Notepad v2/obj/Release/Notatnik.pdb b/Notepad/Notepad v2/obj/Release/Notatnik.pdb index 8a70bc5..db0af9c 100644 Binary files a/Notepad/Notepad v2/obj/Release/Notatnik.pdb and b/Notepad/Notepad v2/obj/Release/Notatnik.pdb differ diff --git a/Notepad/Notepad v2/obj/Release/Notepad v2.csprojAssemblyReference.cache b/Notepad/Notepad v2/obj/Release/Notepad v2.csprojAssemblyReference.cache index 4c4ceaf..f81aff4 100644 Binary files a/Notepad/Notepad v2/obj/Release/Notepad v2.csprojAssemblyReference.cache and b/Notepad/Notepad v2/obj/Release/Notepad v2.csprojAssemblyReference.cache differ