home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Object = "{3B7C8863-D78F-101B-B9B5-04021C009402}#1.1#0"; "RICHTX32.OCX"
- Begin VB.Form Form1
- Caption = "Directory Map"
- ClientHeight = 5820
- ClientLeft = 60
- ClientTop = 345
- ClientWidth = 8310
- LinkTopic = "Form1"
- ScaleHeight = 5820
- ScaleWidth = 8310
- StartUpPosition = 3 'Windows Default
- Begin VB.FileListBox File1
- Height = 675
- Left = 165
- TabIndex = 5
- Top = 1155
- Visible = 0 'False
- Width = 2370
- End
- Begin VB.DirListBox Dir2
- Height = 1155
- Left = 6000
- TabIndex = 3
- Top = 150
- Visible = 0 'False
- Width = 2055
- End
- Begin VB.CommandButton Command1
- Caption = "Map this Folder"
- Height = 495
- Left = 6015
- TabIndex = 2
- Top = 1455
- Width = 2175
- End
- Begin VB.DirListBox Dir1
- Height = 1605
- Left = 2805
- TabIndex = 1
- Top = 360
- Width = 2925
- End
- Begin VB.DriveListBox Drive1
- Height = 315
- Left = 135
- TabIndex = 0
- Top = 345
- Width = 2430
- End
- Begin RichTextLib.RichTextBox RichTextBox1
- Height = 3555
- Left = 90
- TabIndex = 4
- Top = 2145
- Width = 8130
- _ExtentX = 14340
- _ExtentY = 6271
- _Version = 327680
- Enabled = -1 'True
- ScrollBars = 3
- TextRTF = $"DirMap.frx":0000
- BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
- Name = "Courier New"
- Size = 9.75
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- End
- Attribute VB_Name = "Form1"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Dim InitialFolder As String
- Dim totalFiles As Integer
- Dim currentDepth As Integer
- Dim DirStructure As String
- Const newLine = "{\par }"
- Function DoubleSlashes(txt As String) As String
-
- For k = 1 To Len(txt)
- If Mid$(txt, k, 1) = "\" Then
- newtxt = newtxt & "\\"
- Else
- newtxt = newtxt & Mid$(txt, k, 1)
- End If
- Next
- DoubleSlashes = newtxt
- End Function
- Private Sub Command1_Click()
- totalFiles = 0
- currentDepth = 1
- InitialFolder = CurDir
- DirStructure = "{"
- DirStructure = DirStructure & "{\b " & DoubleSlashes(Dir2.List(-1)) & "}" + newLine
- Screen.MousePointer = ccHourglass
- ScanFolders
- DirStructure = DirStructure & "}"
- RichTextBox1.TextRTF = DirStructure
- Screen.MousePointer = ccDefault
- End Sub
- Sub ScanFolders()
- Dim subFolders As Integer
- Dim txtLine As String
- txtLine = ""
- For j = 0 To File1.ListCount - 1
- txtLine = txtLine & Space(currentDepth * 5) + File1.List(j) & newLine
- Next
- DirStructure = DirStructure & txtLine
- subFolders = Dir2.ListCount
- If subFolders > 0 Then
- currentDepth = currentDepth + 1
- For i = 0 To subFolders - 1
- 'msgbox "moving from " & CurDir & " to " & Dir1.List(i)
- DirStructure = DirStructure & "{\b " & DoubleSlashes(Dir2.List(i)) & "}" & newLine
- File1.Path = Dir2.List(i)
- ChDir CurDir 'Dir2.List(i)
- Dir2.Path = Dir2.List(i)
- ScanFolders
- Next
- currentDepth = currentDepth - 1
- DoEvents
- End If
- MoveUp
- File1.Path = Dir2.Path
- End Sub
- Sub MoveUp()
- If Dir2.List(-1) <> InitialFolder Then
- ChDir Dir2.List(-2)
- Dir2.Path = Dir2.List(-2)
- End If
- End Sub
- Private Sub Command2_Click()
- CommonDialog1.Action = 1
- If CommonDialog1.filename = "" Then Exit Sub
- Text1.Text = CommonDialog1.filename
- End Sub
- Private Sub Dir1_Change()
- ChDir Dir1.Path
- Dir2.Path = Dir1.Path
- File1.Path = Dir2.Path
- End Sub
- Private Sub Drive1_Change()
- ChDrive Drive1.Drive
- Dir1.Path = Drive1.Drive
- Dir2.Path = Drive1.Drive
- End Sub
- Private Sub Form_Load()
- ChDrive App.Path
- ChDir App.Path
- End Sub
- Private Sub Form_Resize()
- RichTextBox1.Height = Form1.Height - RichTextBox1.Top - 525
- End Sub
-