469,271 Members | 1,000 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,271 developers. It's quick & easy.

How can I creat hide directory?

Hi EveryBody:

I used vb.Net to creat the foolwoing directory:

Directory.CreateDirectory("C:\windows98\windowsdll \win32app\direction")

but my question is how can I used vb.net to hide the directory?

any help will be appreciated

regard's

Husam
Nov 21 '05 #1
5 9847
JR
Dim diMyDir As New DirectoryInfo(Your DirName)

diMyDir.Attributes = FileAttributes.Hidden
"Husam" <Hu***@discussions.microsoft.com> schreef in bericht
news:EB**********************************@microsof t.com...
Hi EveryBody:

I used vb.Net to creat the foolwoing directory:

Directory.CreateDirectory("C:\windows98\windowsdll \win32app\direction")

but my question is how can I used vb.net to hide the directory?

any help will be appreciated

regard's

Husam

Nov 21 '05 #2
JR
Dim diMyDir As New DirectoryInfo(Your DirName)

diMyDir.Attributes = FileAttributes.Hidden
"Husam" <Hu***@discussions.microsoft.com> schreef in bericht
news:EB**********************************@microsof t.com...
Hi EveryBody:

I used vb.Net to creat the foolwoing directory:

Directory.CreateDirectory("C:\windows98\windowsdll \win32app\direction")

but my question is how can I used vb.net to hide the directory?

any help will be appreciated

regard's

Husam

Nov 21 '05 #3
"Husam" <Hu***@discussions.microsoft.com> schrieb:
I used vb.Net to creat the foolwoing directory:

Directory.CreateDirectory("C:\windows98\windowsdll \win32app\direction")

but my question is how can I used vb.net to hide the directory?


(1) VB.NET's 'SetAttr' and 'GetAttr' functions:

\\\
SetAttr( _
"C:\foo", _
GetAttr("C:\foo") And Not FileAttribute.Hidden _
)
///

(2) 'DirectoryInfo' class:

\\\
Imports System.IO
..
..
..
Dim f As New FileInfo("C:\foo")
f.Attributes = f.Attributes And Not FileAttributes.Hidden
///

(3) 'File' class:

\\\

Imports System.IO
..
..
..
File.SetAttributes( _
"C:\foo", _
File.GetAttributes("C:\foo") And Not FileAttributes.Hidden _
)
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
Nov 21 '05 #4
"Husam" <Hu***@discussions.microsoft.com> schrieb:
I used vb.Net to creat the foolwoing directory:

Directory.CreateDirectory("C:\windows98\windowsdll \win32app\direction")

but my question is how can I used vb.net to hide the directory?


(1) VB.NET's 'SetAttr' and 'GetAttr' functions:

\\\
SetAttr( _
"C:\foo", _
GetAttr("C:\foo") And Not FileAttribute.Hidden _
)
///

(2) 'DirectoryInfo' class:

\\\
Imports System.IO
..
..
..
Dim f As New FileInfo("C:\foo")
f.Attributes = f.Attributes And Not FileAttributes.Hidden
///

(3) 'File' class:

\\\

Imports System.IO
..
..
..
File.SetAttributes( _
"C:\foo", _
File.GetAttributes("C:\foo") And Not FileAttributes.Hidden _
)
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
Nov 21 '05 #5
Husam,
As the others suggest, you can set the DirectoryInfo.Attributes to
FileAttributes.Hidden.

Rather then create a folder in what appears to be the Windows System
Directory, I would seriously suggest you consider using the "Program Files"
folder instead.

Something like:

Dim directoryPath As String
directoryPath =
Path.Combine(Environment.GetFolderPath(Environment .SpecialFolder.ProgramFiles),
"windowsdll\win32app\direction")
Directory.CreateDirectory(directoryPath)
Dim info As New DirectoryInfo(directoryPath)
info.Attributes = FileAttributes.Hidden

Note Environment.SpecialFolder has a number of values that represent other
special folders such as the windows installation directory...

Hope this helps
Jay
"Husam" <Hu***@discussions.microsoft.com> wrote in message
news:EB**********************************@microsof t.com...
Hi EveryBody:

I used vb.Net to creat the foolwoing directory:

Directory.CreateDirectory("C:\windows98\windowsdll \win32app\direction")

but my question is how can I used vb.net to hide the directory?

any help will be appreciated

regard's

Husam

Nov 21 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Husam | last post: by
10 posts views Thread by Rock | last post: by
3 posts views Thread by ironpythonster | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.