private void HTMLCodeFile(string filepath) { StreamReader sr = new StreamReader(filepath); StreamWriter sw = new StreamWriter(Path.GetFileNameWithoutExtension(filepath) + ".txt"); string line = ""; while ((line = sr.ReadLine()) != null) { sw.WriteLine(line); } sw.Flush(); }