Is there a way that I can get the directory name of the user name? I know that if you want the windows folder you use %system directory% can I do that for a user? This is my code
VB Code:
Private Sub brnCleanAll_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles brnCleanAll.Click Dim DirInfo As New IO.DirectoryInfo("C:\Documents and Settings\tony\Cookies") 'file path Dim filesCompleat As Integer ' number of times it went through a loop PB1.Maximum = 'number of files For Each File As IO.FileInfo In DirInfo.GetFiles("*.txt") File.Delete() 'deletes text files PB1.Maximum += 1 Next End Sub
I also need to know how I can find the total number of files before the loop starts
