更改只读文件属性为正常
//设置Test.txt为只读
private void button1_Click(object sender, System.EventArgs e)
{
System.IO.FileInfo file1=new System.IO.FileInfo("Test.txt");
file1.Attributes=System.IO.FileAttributes.ReadOnly;
}
//设置Test.txt为正常
private void button2_Click(object sender, System.EventArgs e)
{
System.IO.FileInfo file1=new System.IO.FileInfo("Test.txt");
file1.Attributes=System.IO.FileAttributes.Normal;
}
//设置Test.txt为只读
private void button1_Click(object sender, System.EventArgs e)
{
System.IO.FileInfo file1=new System.IO.FileInfo("Test.txt");
file1.Attributes=System.IO.FileAttributes.ReadOnly;
}
//设置Test.txt为正常
private void button2_Click(object sender, System.EventArgs e)
{
System.IO.FileInfo file1=new System.IO.FileInfo("Test.txt");
file1.Attributes=System.IO.FileAttributes.Normal;
}