PC Review


Reply
Thread Tools Rate Thread

Changing File Attributes in CF

 
 
Ayronski
Guest
Posts: n/a
 
      18th Feb 2010
As the convenient File.SetAttribute() and File.GetAttribute() do not
exist in the compact framework, I thought I'd share another method of
changing file attributes using FileInfo:

FileInfo fileInf = new FileInfo(myFilePath);

if ((fileInf.Attributes & FileAttributes.ReadOnly) ==
FileAttributes.ReadOnly)
{
fileInf.Attributes = FileAttributes.Normal;
}

HTH.

-ak
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing file attributes Shenan Stanley Windows XP Basics 6 1st Apr 2007 07:26 PM
Changing File Attributes Mike Savage Windows XP General 3 25th Nov 2005 12:50 AM
Changing file attributes =?Utf-8?B?cnVzaGFy?= Windows XP Help 2 20th Aug 2005 09:53 PM
file attributes changing =?Utf-8?B?MmRvemVu?= Windows XP General 3 21st Mar 2004 03:00 PM
changing file attributes Jan Windows XP General 0 29th Jul 2003 10:04 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:26 PM.