I learn about opening and saving files from C #, and it seems that Vista will not allow my program to save the file in the root of C: \ unless I started it in administrator mode.
Any ideas on how to let my program play with any files she wants?
Thank!
private string name;
private void open_Click(object sender, EventArgs e)
{
if (openFileDialog1.ShowDialog() == DialogResult.OK)
{
name = openFileDialog1.FileName;
textBox1.Clear();
textBox1.Text = File.ReadAllText(name);
textBox2.Text = name;
}
}
private void save_Click(object sender, EventArgs e)
{
File.WriteAllText(name, textBox1.Text);
}
source
share