Click here to Skip to main content
15,909,324 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Why does .ThreadState.ToString Behave This Way? Pin
treddie5-Jul-13 19:34
treddie5-Jul-13 19:34 
GeneralRe: Why does .ThreadState.ToString Behave This Way? Pin
Dave Kreskowiak6-Jul-13 4:11
mveDave Kreskowiak6-Jul-13 4:11 
QuestionModules not initializing Pin
treddie4-Jul-13 8:09
treddie4-Jul-13 8:09 
AnswerRe: Modules not initializing Pin
Eddy Vluggen4-Jul-13 9:21
professionalEddy Vluggen4-Jul-13 9:21 
GeneralRe: Modules not initializing Pin
treddie4-Jul-13 10:47
treddie4-Jul-13 10:47 
Questionexcel conditional formatting - or excel control Pin
Member 46241693-Jul-13 4:32
Member 46241693-Jul-13 4:32 
AnswerRe: excel conditional formatting - or excel control Pin
Eddy Vluggen4-Jul-13 5:02
professionalEddy Vluggen4-Jul-13 5:02 
Questionvb.net tree view Pin
walsh273-Jul-13 2:52
walsh273-Jul-13 2:52 
Hi, I need to be able to list all folder, sub folders and files for my application by using a ecurrsive loop how do I do this?

So far I have

VB
Imports System.IO

Partial Class _Default
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        If Not IsPostBack Then

            Dim AppPath As String = Server.MapPath("~/")

            ProcessDirectory(AppPath)
        End If


    End Sub

    Protected Sub ProcessDirectory(ByVal DirPath As String)

        ' Once folder known to search through get all directories

        Dim Dirs() As String = Directory.GetDirectories(DirPath)

        For Each Dir As String In Dirs

            Dim tvwRoot As TreeNode = New TreeNode()

            If Dir.Substring(Dir.LastIndexOf("\") + 1) <> "App_Code" And Dir.Substring(Dir.LastIndexOf("\") + 1) <> "Bin" And Dir.Substring(Dir.LastIndexOf("\") + 1) <> "Files" Then
                ' Literal1.Text = Literal1.Text & " " & Dir.Substring(Dir.LastIndexOf("\") + 1)
                tvwRoot.Value = Dir.Substring(Dir.LastIndexOf("\") + 1).ToString

                'tvwRoot.Expand()

                Dim Files() As String = Directory.GetFiles(Dir, "*.aspx")

                For Each File As String In Files

                    Dim tnChild As TreeNode = New TreeNode()
                    tnChild.Value = File.Substring(File.LastIndexOf("\") + 1).ToString

                    'tnChild.ImageUrl = ""

                    tvwRoot.ChildNodes.Add(tnChild)

                    'TreeView1.Nodes.Add(tvwChild)
                Next

                TreeView1.Nodes.Add(tvwRoot)

                Dim SubDirs() As String = Directory.GetDirectories(Dir)

                For Each SubDir As String In SubDirs

                    Dim tvwSubFolder As TreeNode = New TreeNode()

                    tvwSubFolder.Value = SubDir.Substring(SubDir.LastIndexOf("\") + 1)
                    tvwRoot.ChildNodes.Add(tvwSubFolder)


                    Dim SubFiles() As String = Directory.GetFiles(Dir, "*.aspx")

                    For Each File As String In SubFiles

                        Dim tnChild As TreeNode = New TreeNode()
                        tnChild.Value = File.Substring(File.LastIndexOf("\") + 1).ToString

                        'tnChild.ImageUrl = ""

                        tvwSubFolder.ChildNodes.Add(tnChild)

                        'TreeView1.Nodes.Add(tvwChild)
                    Next
                Next

            End If
        Next

    End Sub

AnswerRe: vb.net tree view Pin
Eddy Vluggen4-Jul-13 3:16
professionalEddy Vluggen4-Jul-13 3:16 
QuestionWebcam Capture and print A5 Paper, Codes (Two Cameras) Pin
Uğur Şirin1-Jul-13 22:57
Uğur Şirin1-Jul-13 22:57 
AnswerRe: Webcam Capture and print A5 Paper, Codes (Two Cameras) Pin
Eddy Vluggen2-Jul-13 0:32
professionalEddy Vluggen2-Jul-13 0:32 
Questionvb6 to vb.net Pin
Smith00530-Jun-13 19:13
Smith00530-Jun-13 19:13 
AnswerRe: vb6 to vb.net Pin
Dave Kreskowiak1-Jul-13 2:21
mveDave Kreskowiak1-Jul-13 2:21 
QuestionHow to get address of a function or method Pin
treddie30-Jun-13 11:05
treddie30-Jun-13 11:05 
AnswerRe: How to get address of a function or method Pin
TnTinMn30-Jun-13 16:46
TnTinMn30-Jun-13 16:46 
GeneralRe: How to get address of a function or method Pin
treddie1-Jul-13 12:17
treddie1-Jul-13 12:17 
GeneralRe: How to get address of a function or method Pin
TnTinMn1-Jul-13 14:28
TnTinMn1-Jul-13 14:28 
GeneralRe: How to get address of a function or method Pin
treddie1-Jul-13 20:43
treddie1-Jul-13 20:43 
GeneralRe: How to get address of a function or method Pin
TnTinMn2-Jul-13 7:32
TnTinMn2-Jul-13 7:32 
GeneralRe: How to get address of a function or method Pin
treddie2-Jul-13 9:35
treddie2-Jul-13 9:35 
AnswerRe: How to get address of a function or method Pin
Bernhard Hiller1-Jul-13 0:57
Bernhard Hiller1-Jul-13 0:57 
GeneralRe: How to get address of a function or method Pin
treddie1-Jul-13 12:18
treddie1-Jul-13 12:18 
GeneralRe: How to get address of a function or method Pin
treddie1-Jul-13 20:30
treddie1-Jul-13 20:30 
AnswerRe: How to get address of a function or method Pin
Richard Deeming1-Jul-13 1:54
mveRichard Deeming1-Jul-13 1:54 
GeneralRe: How to get address of a function or method Pin
treddie1-Jul-13 12:20
treddie1-Jul-13 12:20 

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.