VB 2005 - How to check and modity the file attributes

I

Ian Wong

My case is :
User 1 create a file (abc.txt) on ProgramData\ABC.
User 2 is not right to update the file (abc.txt)

My coding :
If
(My.Computer.FileSystem.GetFileInfo("C:\ProgramData\ABC\abc.txt").Attributes
And FileAttributes.ReadOnly) = FileAttributes.ReadOnly
MessageBox.Show ("File is read only !")
Else
MessageBox.Show
(My.Computer.FileSystem.GetFileInfo("C:\ProgramData\ABC\abc.txt").Attributes)
End If

The result of User 2 :
The message box does not show the "File is read only !" message and show the
number 74344.

If I want to modify the file attributes for all users can modify the file,
what is the coding of VB 2005 ?
 
T

Tom van Stiphout

On Thu, 14 Jan 2010 22:43:01 -0800, Ian Wong

This is not a querstion about DAO and VBA programming for the
Microsoft Access database program. You would be better off asking your
question in a more appropriate forum.

-Tom.
Microsoft Access MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top