How Delete File with Readonly Permission?
class Program
{
static void Main(string[] args)
{
string file=@"E:\readme.txt";
try
{
File.SetAttributes(file, FileAttributes.Normal);
File.Delete(file);
}
catch (Exception exp)
{
Console.WriteLine(exp.Message);
}
Console.ReadLine();
}
}
How Delete File with Readonly Permission?的更多相关文章
- 数据库迁移后报错提示MySQL Error:Can''t find file errno: 13 - Permission denied的解决方法
用户MYSQL数据库迁移后,遇到报错MySQL Error:Can't find file (errno: 13 - Permission denied)使用以下指令重新设置所有者和权限,依然不能解决 ...
- delete file SVN commit error has no URL
在提交SVN的时候遇到这个提交失败的提示: delete file SVN commit error has no URL 我的提交顺序是: 先在自己工程的文件夹删除 ->工程中删除 -> ...
- jquery ajax发送delete(use in jquery file upload delete file)
环境: jQuery file upload HTML example code <div class="pic-preview"> <div class=&qu ...
- 無法使用 adb push file,Read-only file system
adb root adb remount adb push xxx /system/etc/xxx failed to copy 'xxx' to '/system/etc/xxx': couldn' ...
- delete file by bat
@echo off set logFile=AmazonDeleteFiles.log set Feeds="E:\AmazonProject\AmazonListing\AmazonLis ...
- 在eclipse中遇到cannot open output file xxx.exe: Permission denied 的解决办法
该问题出现的原因主要原因是,编译后运行的程序未能正确关闭,解决方法:删除debug目录即可 同理在vc6.0遇到同样问题时,删除debug目录,或者重启vc6.0即可
- SVN报错:can't open file db/txn-current-lock:permission denied 解决方法
其实这个问题是这样的.下面我举个例子:比如版本库SVN是root用户创建的但是启动服务的时候没有选择root启动,而是在其他用户转托管太下启动的,所以只能读不能写. 解决方法:停止svn服务:kill ...
- linux delete file
今天不小心生成了这么个文件名的文件-ep-ser 然后 rm -ep-ser就删除不了,它认为-e是option 后来,用rm ./-ep-ser就顺利删除了,哈哈,教训啊
- Java.io.File中的delete()方法和deleteOnExit()方法的区别
1.delete()方法: 当调用delete()方法时,直接删除文件,不管该文件是否存在,一经调用立即执行: 2.deleteOnExit()方法: 当 ...
随机推荐
- IIS7中配置FastCGI运行PHP
环境说明: 操作系统:使用windows 2008 server 64位系统,IIS7.5PHP版本:官方下载PHP 5.4.16 VC9 x86 Non Thread SafeZIP版本.PHP路径 ...
- 解决PHP在IE中下载文件,中文文件名乱码问题
if( stripos($_SERVER['HTTP_USER_AGENT'], 'MSIE')!==false ) $filename = urlencode( $filename ); // 输入 ...
- mysql数据类型最大长度记录
MySQL中各数据类型的取值范围 转在这里,慢慢记下来. TINYINT -128 - 127 TINYINT UNSIGNED 0 - 255 SMALLINT -32768 - 32767 SMA ...
- codeforces 361 D - Friends and Subsequences
原题: Description Mike and !Mike are old childhood rivals, they are opposite in everything they do, ex ...
- swift 代码添加image
let image_ElectricianBtn = UIImage(named: "ElectricianBtn") let vimage_ElectricianBtn = UI ...
- html() 和 text() 方法的区别
html()方法仅支持XHTML的文档,不能用于XML文档,而text()既支持HTML文档,也 支持XML文档. html():没有参数,用于获取html的值: html(val):有参数,用于设置 ...
- java.net.URL 模拟用户登录网页并维持session
java.net.URL 模拟用户登录网页并维持session 半成品,并非完全有用 import java.io.BufferedReader; import java.io.InputStream ...
- dojo 加载Json数据
1.今天研究了dojo datagrid加载WebService后台传上来的数据.研究来研究去发现他不是很难.用谷歌多调试一下就好了. 2.看很多例子,这个例子能够更好的帮我解决问题:https:// ...
- Train Problem I hdu 1022(栈)
http://acm.split.hdu.edu.cn/showproblem.php?pid=1022 题意:给出火车的进站与出站顺序,判断是否可以按照给出的出站顺序出站. #include < ...
- MySQL表分区
MySQL的表分区 一.什么是表分区通俗地讲表分区是将一大表,根据条件分割成若干个小表.mysql5.1开始支持数据表分区了.如:某用户表的记录超过了600万条,那么就可以根据入库日期将表分区,也可以 ...