i am writing the code for reading folders , subfolders and subfiles of a given folder and i am writing all those folders,subfolders list in a text file. try this
Imports System.IO
Public Class Form1
Dim dirpath As String
Function GetFolderSize(ByVal dPath As String, ByVal includeSubFolders As Boolean) As Long
Dim files() As String
files = System.IO.Directory.GetFil
Dim objAssembly As Reflection.Assembly = Reflection.Assembly.GetAss
Dim strAppPath As String = objAssembly.CodeBase
strAppPath = strAppPath.Replace("Window
Dim objUri As Uri = New Uri(strAppPath)
strAppPath = Application.StartupPath 'objUri.AbsolutePath
Dim strBatchFilePath As String = strAppPath + "\folders.txt"
Dim sw As StreamWriter = Nothing
sw = File.CreateText(strBatchFi
Dim ReadString As String = "@echo off"
sw.WriteLine(ReadString)
For Each fname As String In files
' Console.WriteLine(fname)
sw.WriteLine(fname)
Next
End Function
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
GetFolderSize("f:\gopi", True)
End Sub
End Class
if you want to show these folders, sub folders in a treeview let me know....
Main Topics
Browse All Topics





by: appariPosted on 2007-03-28 at 21:28:34ID: 18813669
try this
es("c:\wor k\", "*.*", IO.SearchOption.AllDirecto ries)
Dim files() As String
files = System.IO.Directory.GetFil
For Each fname As String In files
Console.WriteLine(fname)
Next