I am attempting to create an application which updates a config file.
I have made the following form:
I have also created the following code:
using System;
using System.IO;
using System.Windows.Forms;
namespace DebugOnOrOff
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
string text = File.ReadAllText("C:\\Users\\User\\Desktop\\app.config");
text = text.Replace("DebugOff", "DebugOn");
File.WriteAllText("app.config", text);
}
}
}