Click here to Skip to main content
15,922,015 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionHow to set a directory hidden? Pin
cylix20001-Mar-06 14:29
cylix20001-Mar-06 14:29 
AnswerRe: How to set a directory hidden? Pin
Klazen1-Mar-06 15:56
Klazen1-Mar-06 15:56 
GeneralRe: How to set a directory hidden? Pin
cylix20001-Mar-06 22:21
cylix20001-Mar-06 22:21 
AnswerRe: How to set a directory hidden? Pin
Omar Mallat2-Mar-06 2:22
professionalOmar Mallat2-Mar-06 2:22 
Questionvb.net sockets problem Pin
Robert Rowley1-Mar-06 9:51
Robert Rowley1-Mar-06 9:51 
Questiontransparent textbox/richtextbox Pin
randomGirl0071-Mar-06 9:49
randomGirl0071-Mar-06 9:49 
AnswerRe: transparent textbox/richtextbox Pin
Klazen1-Mar-06 15:36
Klazen1-Mar-06 15:36 
QuestionFolder attributes problem Pin
Quecumber2561-Mar-06 7:38
Quecumber2561-Mar-06 7:38 
Hello Everyone:
I want to make a program that incorporates an explorer style user interface. The left hand side shows a tree structure of drives and folders. While the right hand side shows a list of the files inside a selected folder.

Inside VB 6 there is a simple routine called ShowFolderList. I have modified it a bit to show the attribute number for each folder the routine returns.

Here is the modified routine:
Sub ShowFolderList(strPath As String)
Dim fs, f, f1, fc, s
Dim Attr As Integer
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFolder(strPath)
Set fc = f.SubFolders
For Each f1 In fc
Attr = GetAttr(strPath & f1.Name)
Debug.Print f1.Name & " Attr: " & CStr(Attr)
Next
End Sub

I’m sending in “C:\” as the path, because I want a list of all the folders on this hard drive. I’m also listing the Attribute number for each folder. Now here is the noggin scratchier. When I show a list of the folders I returned I see some attribute numbers that are not defined in the attributes constants in VB.

Here is the list I get from my laptop using the above routine:
Adv_Basics Attr: 16
Adv_Doc_Production Attr: 16
Backup_Exp Attr: 16
Config.Msi Attr: 22
Cosmetology Attr: 16
Documents and Settings Attr: 16
Program Files Attr: 17
RECYCLER Attr: 22
SHFileOperation Attr: 16
swsetup Attr: 16
System Volume Information Attr: 22
SYSTEM.SAV Attr: 16
TreeView_Test Attr: 16
WINDOWS Attr: 16

I’m interested in only the folders on the hard drive. So the folders with a 22 attribute need not be shown. But the Programs Files folder has an attribute number of 17, and 17 is not defined as a directory. A directory or folder attribute number is 16.

So my first question is: Why is the Program Files folder attribute a 17? And the second one is: How can I modify the routine to return only unhidden folders and non-system folders?

Thank you



Quecumber256
AnswerRe: Folder attributes problem Pin
Dave Kreskowiak1-Mar-06 9:00
mveDave Kreskowiak1-Mar-06 9:00 
GeneralRe: Folder attributes problem Pin
Quecumber2561-Mar-06 9:41
Quecumber2561-Mar-06 9:41 
GeneralRe: Folder attributes problem Pin
Dave Kreskowiak1-Mar-06 11:54
mveDave Kreskowiak1-Mar-06 11:54 
GeneralRe: Folder attributes problem Pin
Quecumber2561-Mar-06 12:42
Quecumber2561-Mar-06 12:42 
GeneralRe: Folder attributes problem Pin
Dave Kreskowiak1-Mar-06 12:56
mveDave Kreskowiak1-Mar-06 12:56 
AnswerRe: Folder attributes problem Pin
Guffa1-Mar-06 13:12
Guffa1-Mar-06 13:12 
QuestionVb.Net Forms Issue Pin
projectcode11-Mar-06 7:01
projectcode11-Mar-06 7:01 
AnswerRe: Vb.Net Forms Issue Pin
Dave Kreskowiak1-Mar-06 8:26
mveDave Kreskowiak1-Mar-06 8:26 
GeneralRe: Vb.Net Forms Issue Pin
projectcode11-Mar-06 8:41
projectcode11-Mar-06 8:41 
GeneralRe: Vb.Net Forms Issue Pin
Dave Kreskowiak1-Mar-06 9:03
mveDave Kreskowiak1-Mar-06 9:03 
GeneralRe: Vb.Net Forms Issue Pin
Tyrone_whitey1-Mar-06 9:45
Tyrone_whitey1-Mar-06 9:45 
GeneralRe: Vb.Net Forms Issue Pin
projectcode11-Mar-06 10:16
projectcode11-Mar-06 10:16 
GeneralRe: Vb.Net Forms Issue Pin
Dave Kreskowiak1-Mar-06 11:32
mveDave Kreskowiak1-Mar-06 11:32 
GeneralRe: Vb.Net Forms Issue Pin
projectcode12-Mar-06 3:48
projectcode12-Mar-06 3:48 
GeneralRe: Vb.Net Forms Issue Pin
Dave Kreskowiak2-Mar-06 6:23
mveDave Kreskowiak2-Mar-06 6:23 
QuestionWMI in VB.NET Pin
andyr20051-Mar-06 6:54
andyr20051-Mar-06 6:54 
AnswerRe: WMI in VB.NET Pin
Jim Matthews1-Mar-06 7:29
Jim Matthews1-Mar-06 7:29 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.