private void Button_save_Click(object sender, EventArgs e) { string s = richTextBox1.Text; byte[] bytes; if (checkBox_compress.Checked) { bytes = Compress.CompressString(s); } else { bytes = Encoding.UTF8.GetBytes(s); } string path = Application.StartupPath + "\\SavedNovels\\" + novelName; if (!Directory.Exists(path)) { Directory.CreateDirectory(path); } File.WriteAllBytes(path + "\\" + readtitle + ".novel", bytes); }