zoukankan
html css js c++ java
在ASP.NET去掉文件的只读属性
我们可以使用 System.IO.File 类的 SetAttributes 方法为一个文件设置相关的属性,如:
//
为文件加上一个只读的属性
FileAttributes attrs
=
File.GetAttributes(
"
c:\\a.txt
"
);
File.SetAttributes(
"
c:\\a.txt
"
, attrs
|
FileAttributes.ReadOnly);
怎么把这个只读属性去掉呢?
//
先把文件的属性读取出来
FileAttributes attrs
=
File.GetAttributes(
"
c:\\a.txt
"
);
//
下面表达式中的 1 是 FileAttributes.ReadOnly 的值
// 此表达式是把 ReadOnly 所在的位改成 0,
attrs
=
(FileAttributes)((
int
)attrs
&
~
(
1
));
File.SetAttributes(
"
c:\\a.txt
"
, attrs);
查看全文
相关阅读:
ajax请求先发后至问题处理
Jquery 使用val时触发change事件
let与var的几个主要区别
正则表达式s字符匹配
Ext.DateField设置Format无法提交数据
swift基本示例
div 中文会换行 英文不换行
js 动画提示数据有变化
为什么要写博客
突然发现一个开源项目TXQR和我之前申请的一个专利挺像的
原文地址:https://www.cnblogs.com/kuku/p/81630.html
最新文章
Android开发-API指南-<uses-feature>
Android 关于arm64-v8a、armeabi-v7a、armeabi、x86下的so文件兼容问题
Android近场通信---NFC基础转)
Android中pendingIntent的深入理解
Eclipse导入工程提示“No projects are found to import”
Android 识别身份证号码(图片识别)
T-SQL查询高级—SQL Server索引中的碎片和填充因子
MSSQLSERVER执行计划详解
plupload如何限制上传文件数量,限制只能上传单个文件
Plupload的几个demo
热门文章
uploadifive 1.1.2 动态传参
详解intent和intentfilter
在Eclipse IDE使用Gradle构建应用程序
Android NFC M1卡读写&芯片卡读写(CPU卡读写)(RFID读写)
Gprinter Android SDK V1.0 使用说明
Android
(转)eclipse导入Gradle项目
一个类型初始值设定项引发异常的解决方法
JS阻止冒泡,来自网上一篇讲的比较全的
企业微信电脑端无法使用wx.imagePreview
Copyright © 2011-2022 走看看