Page 1 of 1
Modify File Attributes How to create an application that can modify file attributes
#5
Re: Modify File Attributes
Posted 02 August 2007 - 12:59 AM
To work with the attributes of a file research the System.IO.File Class. In it is the FileAttributes class that you are looking for, here a few examples of how this works
To make a file read only
To make a hidden file not hidden
To set a files last accessed date
To mark a file as being a system file
Those are just a few examples of how to work with the System.IO.File class. Hope this helps
To make a file read only
Dim attribute as System.IO.FileAttributes = FileAttributes.ReadOnly
File.SetAttributes("file1.txt", attribute)
To make a hidden file not hidden
dim attribute as System.IO.FileAttributes=IO.FileAttributes.Normal
System.IO.File.SetAttributes("file1.txt",attribute)
To set a files last accessed date
System.IO.File.SetLastAccessTime("file1.txt", Date.Now)
To mark a file as being a system file
Dim attribute As System.IO.FileAttributes = IO.FileAttributes.System
System.IO.File.SetAttributes("file1.txt", attribute)
Those are just a few examples of how to work with the System.IO.File class. Hope this helps
#7
Re: Modify File Attributes
Posted 14 July 2010 - 04:44 AM
hello people, okay?
I need to change the attribute of a hidden file to be visible, so I'm doing this from a Windows Mobile to a file server windows 2003, my problem is that the project of VS 2008 VB dotNET function SetAttributes GetAttributes or does not appear System.IO.File of the options, can someone help me?
Thank you in advance.
I need to change the attribute of a hidden file to be visible, so I'm doing this from a Windows Mobile to a file server windows 2003, my problem is that the project of VS 2008 VB dotNET function SetAttributes GetAttributes or does not appear System.IO.File of the options, can someone help me?
Thank you in advance.
Page 1 of 1

Reply





MultiQuote




|