PC Review


Reply
Thread Tools Rate Thread

How can I creat hide directory?

 
 
=?Utf-8?B?SHVzYW0=?=
Guest
Posts: n/a
 
      19th Mar 2005
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
 
Reply With Quote
 
 
 
 
JR
Guest
Posts: n/a
 
      19th Mar 2005
Dim diMyDir As New DirectoryInfo(Your DirName)

diMyDir.Attributes = FileAttributes.Hidden


"Husam" <(E-Mail Removed)> schreef in bericht
news:EB03631C-3238-4319-AF1C-(E-Mail Removed)...
> 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



 
Reply With Quote
 
Herfried K. Wagner [MVP]
Guest
Posts: n/a
 
      19th Mar 2005
"Husam" <(E-Mail Removed)> 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/>
 
Reply With Quote
 
Jay B. Harlow [MVP - Outlook]
Guest
Posts: n/a
 
      20th Mar 2005
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" <(E-Mail Removed)> wrote in message
news:EB03631C-3238-4319-AF1C-(E-Mail Removed)...
> 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



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how can i hide a directory on the server =?Utf-8?B?V2Vic3Rhci1EZXNpZ25z?= Microsoft Frontpage 1 12th Mar 2006 05:46 AM
how can i hide a directory on the server =?Utf-8?B?V2Vic3Rhci1EZXNpZ25z?= Microsoft Frontpage 0 11th Mar 2006 05:29 PM
Hide Directory programmatically =?Utf-8?B?RUs=?= Microsoft Dot NET Framework 1 29th Nov 2004 11:28 AM
Can I hide a directory ??? Pepe Duran Storage Devices 14 20th Jun 2004 07:29 AM
Cannot creat directory Debi Windows XP New Users 1 15th Aug 2003 10:34 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:39 PM.