I have a code below to get a specific file from my computer into the vb.net application I am developing.
Is there anyone who knows how to change the path? What if I will try to put the application on a different computer? Or rather getting a music file from other folder? The Application.StartupPath doesn't work. :(
If System.IO.Directory.Exists("C:\Documents and Settings\Mitchikels\My Documents\AVDC\Downloaded Files") Then Dim myDir As New System.IO.DirectoryInfo("C:\Documents and Settings\Mitchikels\My Documents\AVDC\Downloaded Files") For Each myFile As System.IO.FileInfo In myDir.GetFiles("*.mp3") Dim lvwItem As ListViewItem = lvdownloaded.Items.Add(myFile.Name.ToString()) lvwItem.SubItems.Add(myFile.Extension.ToString()) length = ((myFile.Length.ToString / 1024) / 1024) length = Format(length, "0.00") lvwItem.SubItems.Add(length & " " & sizetext) Next End If