string abc = this.textBox1.Text.ToString() + '\\'+ this.label3.Text.ToString();
File.Copy(this.label11.Text, this.textBox1.Text + '\\' + this.label3.Text + ".dat",true);
System.IO.File.SetAttributes(this.label11.Text, System.IO.File.GetAttributes(this.label11.Text) | FileAttributes.ReadOnly);
System.IO.File.SetAttributes(abc, System.IO.File.GetAttributes(abc) | FileAttributes.ReadOnly);
执行到这段代码就异常报错了说无法找到该文件,我设断点看了路径是对的,也copy上去了,我想把copy之后的文件该成只读,为什么会没找到文件呢?
System.IO.File.SetAttributes(abc, System.IO.File.GetAttributes(abc) | FileAttributes.ReadOnly);
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货