Results 1 to 5 of 5

Thread: user name

Threaded View

  1. #1

    Thread Starter
    Member
    Join Date
    Jan 2005
    Location
    Minnesota
    Posts
    46

    user name

    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:
    1. Private Sub brnCleanAll_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles brnCleanAll.Click
    2.         Dim DirInfo As New IO.DirectoryInfo("C:\Documents and Settings\tony\Cookies") 'file path
    3.         Dim filesCompleat As Integer ' number of times it went through a loop
    4.         PB1.Maximum = 'number of files
    5.  
    6.         For Each File As IO.FileInfo In DirInfo.GetFiles("*.txt")
    7.             File.Delete() 'deletes text files
    8.             PB1.Maximum += 1
    9.         Next
    10.  
    11.     End Sub

    I also need to know how I can find the total number of files before the loop starts
    Last edited by tonyrueb; Jan 11th, 2005 at 04:24 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width