dclst help
Moderator: Moderators
-
- Posts: 6
- Joined: 2003-02-06 20:20
- Location: Ohio
- Contact:
dclst help
Okay, i need a bit of assistance with the DC list. I can download it, unhuff it, then see it in the normal text heirarchial way. But my brain hurts to much to figure out how to load the folders into a listview respectively. So if anyone here has any knowledge or VB source on that, then that would be great
Yep its me i think
-
- Posts: 6
- Joined: 2003-02-06 20:20
- Location: Ohio
- Contact:
-
- Posts: 6
- Joined: 2003-02-06 20:20
- Location: Ohio
- Contact:
sorry i might have been a little vague on what i was searching for. When you get a users share list and open it in a text editor, after being unrared or unhuffed, you see a heirarchial display of the users share.
Root Folder
Sub Folder
Sub Folder
Sub Folder
File
Sub Folder
File
File
in that format.
I am trying to build the viewer for that, a treeview for the folders and a listview for the files. I am having trouble getting the folders into the treeview respectively.
Also appologize for the last post, was a little agrivated with the whole problem after having been trying for the last 4 days now
Root Folder
Sub Folder
Sub Folder
Sub Folder
File
Sub Folder
File
File
in that format.
I am trying to build the viewer for that, a treeview for the folders and a listview for the files. I am having trouble getting the folders into the treeview respectively.
Also appologize for the last post, was a little agrivated with the whole problem after having been trying for the last 4 days now
Yep its me i think
-
- Posts: 6
- Joined: 2003-02-06 20:20
- Location: Ohio
- Contact:
-
- Posts: 6
- Joined: 2003-02-06 20:20
- Location: Ohio
- Contact:
Uhmm... why not post the code (or at least a link to the code) that you use to do this here, then? This would make it easier for all those young, aspiring VB programmers that you once belonged who read this thread to get something out of it.skully zerø wrote:never mind i finally took the time to figure it out, its not really that hard i just didnt want to waste the time doing it hehe
Sarf
---
It can't rain all the time
-
- Posts: 6
- Joined: 2003-02-06 20:20
- Location: Ohio
- Contact:
k this snippet, its kinda a slow process will load the text from a file into a string, then parce out only the folders and add it into a treeview, its a process before that that unzips or unhuffs the file to do this, as i said it only does the treeview stuff right now
and there it is, all ya need to read a normal plain text file into a treeview with respective heirarchial positioning, have fun
Code: Select all
Public Sub OpenList(ThePath As String)
ShareNum = ShareNum + 1
ReDim ShareView(ShareNum) As frmShareView
Set ShareView(ShareNum) = New frmShareView
Dim Text1 As String
Dim SubNode(0 To 100) As Node
Dim ManySubs As Integer
TName = Mid(ThePath, InStrRev(ThePath, "\") + 1, InStrRev(ThePath, ".") - 1)
ShareView(ShareNum).Caption = TName
FileNum = FreeFile
Open ThePath For Input As FileNum
NewLine = Input(LOF(FileNum), FileNum)
Text1 = NewLine
Close #1
TFirst = Mid(Text1, 1, InStr(1, Text1, vbCrLf) - 1)
Set SubNode(0) = ShareView(ShareNum).tvwFolder.Nodes.Add(, , , TFirst, 1)
Text1 = Mid(Text1, InStr(1, Text1, vbCrLf) + 2)
Last = 0
Do
tline = Mid(Text1, 1, InStr(1, Text1, vbCrLf) - 1)
Text1 = Mid(Text1, InStr(1, Text1, vbCrLf) + 2)
If InStr(1, tline, "|") < 1 Then
ret = CountOcc(CStr(tline), vbTab)
tline = Replace(tline, vbTab, "")
If ret = 0 Then
ManySubs = 0
Set SubNode(0) = ShareView(ShareNum).tvwFolder.Nodes.Add(, , , tline, 1)
ElseIf ret = 1 Then
ManySubs = 1
Set SubNode(1) = ShareView(ShareNum).tvwFolder.Nodes.Add(SubNode(0), tvwChild, , tline, 1)
ElseIf Last < ret Then
ManySubs = ManySubs + 1
Set SubNode(ManySubs) = ShareView(ShareNum).tvwFolder.Nodes.Add(SubNode(ManySubs - 1), tvwChild, , tline, 1)
ElseIf Last = ret Then
Set SubNode(ManySubs) = ShareView(ShareNum).tvwFolder.Nodes.Add(SubNode(ManySubs - 1), tvwChild, , tline, 1)
ElseIf ret < Last Then
If past <> ManySubs Then
ManySubs = ManySubs - 1
End If
Set SubNode(ManySubs) = ShareView(ShareNum).tvwFolder.Nodes.Add(SubNode(ManySubs - 1), tvwChild, , tline, 1)
End If
past = ManySubs
Last = ret
End If
DoEvents
Loop Until InStr(1, Text1, vbCrLf) < 1
ShareView(ShareNum).Show
End Sub
Public Function CountOcc(SourceStr As String, ToFindStr As String) As Long
r = Replace(SourceStr, ToFindStr, "")
CountOcc = Len(SourceStr) - Len(r)
End Function
Yep its me i think