VB.NET School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Page 1 of 1
  • You cannot start a new topic
  • Reply Reply

Modify File Attributes How to create an application that can modify file attributes Rate Topic: -----

#1 Junkboy  Icon User is offline

  • New D.I.C Head
  • Pip

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 13-June 07


Dream Kudos: 0

Share |

Modify File Attributes

Posted 01 August 2007 - 11:20 PM

Hi, I need help to create an app that can modify file attribute like hidden, archive, read-only. Thanks
Was This Post Helpful? 0
  • +
  • -

#5 PsychoCoder  Icon User is offline

  • iHater.Init(this);
  • Icon

Reputation: 1364
  • View blog
  • Posts: 19,696
  • Joined: 26-July 07


Dream Kudos: 12925

Expert In: VB, VB.Net, C#, SQL, ASP, ASP.Net, Web Development, HTML, CSS, Win32 API, Javascript, mySQL, J#, Boo.Net, jQuery

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

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 :)
Was This Post Helpful? 1

#6 Jack Eagles1  Icon User is offline

  • D.I.C Fanatic
  • Icon

Reputation: 52
  • Posts: 622
  • Joined: 10-December 08


Dream Kudos: 375

Re: Modify File Attributes

Posted 27 December 2008 - 11:23 AM

TYSM!! Exactly what I have been looking 4 :)
Was This Post Helpful? 0
  • +
  • -

#7 m4v0  Icon User is offline

  • New D.I.C Head
  • Pip

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 14-July 10


Dream Kudos: 0

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.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1
  • You cannot start a new topic
  • Reply Reply


Fast Reply

  

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users