How to get directory Info(readonly or not...) knowing the full Path???

  • Thread starter Thread starter Ms.net
  • Start date Start date
I know the path of my directory.
Now i want to check its attributes.
But there is no function( i do not find) ,which will take path of directory
and return directoryinfo :-(
 
Ms.net said:
I know the path of my directory.
Now i want to check its attributes.
But there is no function( i do not find) ,which will take path of
directory and return directoryinfo :-(

dim di as new system.io.directoryinfo(yourpath)
msgbox di.attributes
 
Hello,

Ms.net said:
I know the path of my directory.
Now i want to check its attributes.
But there is no function( i do not find) ,which will take path of directory
and return directoryinfo :-(

\\\
Imports System.IO
..
..
..
Dim di As New DirectoryInfo("C:\.......")
....
///

HTH,
Herfried K. Wagner
 
Thanks you to all... :-))





Herfried K. Wagner said:
Hello,



\\\
Imports System.IO
.
.
.
Dim di As New DirectoryInfo("C:\.......")
...
///

HTH,
Herfried K. Wagner
 
Hello,

Ms.net said:
i shared a folder and set access to FULL, Read ,write
is set to TRUE from windows.
TempPath="\elysee\mysharefolder"
Dim mydir As DirectoryInfo = New irectoryInfo(TempPath)

If mydir.Attributes.ReadOnly Then Throw New Exception ("read only
directory")

But the exception is throw......WHY???

Untested:

\\\
If (MyDir.Attributes And FileAttributes.ReadOnly) =
FileAttributes.ReadOnly Then
...
End If
///

HTH,
Herfried K. Wagner
 
Ms.net said:
Strange.

i shared a folder and set access to FULL, Read ,write is set to TRUE
from windows.
TempPath="\elysee\mysharefolder"
Dim mydir As DirectoryInfo = New irectoryInfo(TempPath)

If mydir.Attributes.ReadOnly Then Throw New Exception ("read only
directory")

But the exception is throw......WHY???

Enable option strict in the project's properties and you'll see why it does
not work.
 
IT WORK.
THANKS U

Herfried K. Wagner said:
Hello,



Untested:

\\\
If (MyDir.Attributes And FileAttributes.ReadOnly) =
FileAttributes.ReadOnly Then
...
End If
///

HTH,
Herfried K. Wagner
 
Back
Top