会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
Nice感觉
海绵不断的吸收
博客园
首页
新随笔
联系
订阅
管理
更改只读文件属性为正常
更改只读文件属性为正常
//
设置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;
}
posted on
2006-08-18 13:49
Gary.han
阅读(
1242
) 评论(
0
)
收藏
举报
刷新页面
返回顶部