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

H

Herfried K. Wagner [MVP]

Hello,

[Nothing]

DirectoryInfo.Attributes

HTH,
Herfried K. Wagner
 
M

Ms.net

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 :-(
 
A

Armin Zingler

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
 
H

Herfried K. Wagner [MVP]

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
 
M

Ms.net

Thanks you to all... :))





Herfried K. Wagner said:
Hello,



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

HTH,
Herfried K. Wagner
 
H

Herfried K. Wagner [MVP]

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
 
A

Armin Zingler

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.
 
M

Ms.net

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
 

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