Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Distributed Applications / March 2006

Tip: Looking for answers? Try searching our database.

Getting Folder attributes

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
jvn - 23 Feb 2006 15:39 GMT
Hi,
  I am trying to find out whether a given folder is a readonly or not. The
code below works great if the folder is on a local drive but does not work if
it is a UNC Path.

  The attributes returns 48 for UNC and I am not sure what that is and for
Local drive it returns 17 (Readonly)

  Any help regards in this is greatly appreciated.  

CODE:
------
      Dim checkFile As System.IO.DirectoryInfo
       checkFile = New System.IO.DirectoryInfo("\\server\production\data")
       Dim attributeReader As System.IO.FileAttributes
       attributeReader = checkFile.Attributes
       If (attributeReader And System.IO.FileAttributes.ReadOnly) > 0 Then
           MsgBox("Directory is read only")
       Else
           MsgBox("Can write")
       End If

Thanks
gbergalli@gmail.com - 24 Mar 2006 02:11 GMT
im getting the3 same error, while trying to find out if a given path on the local drives represents a file or a folder, so far the onlything i thought, is that 48=32+16
32 and 16 are the int values that represent directory and archive

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.