filePath = txtFilePath.Text;oldPath = txtOld.Text;newPath = txtNew.Text;string output = File.ReadAllText(filePath);output = Regex.Replace(output, oldValue, newValue, RegexOptions.IgnoreCase);File.WriteAllText(filePath, output);