none
獲取檔案問題 RRS feed

  • 問題

  • 檔案名稱顯示能移除副檔名.mp3? (只顯示 Wonder Girls - Nobody)

    而檔案大小只讀取檔案2位小數? 例 : 4.22 MB (其他尾數去除)

          For Each fi As String In My.Computer.FileSystem.FindInFiles("C:\Users\Rocky\Music", _
           txtSearchKeyWord.Text, True, FileIO.SearchOption.SearchAllSubDirectories)
            Dim theFile As String = fi
            Dim fType As String
            If File.Exists(theFile) Then
              Dim myFileInfo As New FileInfo(theFile)
    
              LI = DSList.DownloadListView.Items.Add(myFileInfo.Name)
              LI.SubItems.Add(myFileInfo.Length / 1000000 & " MB")
              If myFileInfo.Extension = ".mp3" Then
                fType = "MP3"
              ElseIf myFileInfo.Extension = ".wav" Then
                fType = "WAV"
              ElseIf myFileInfo.Extension = ".wma" Then
                fType = "WMA"
              ElseIf myFileInfo.Extension = ".mid" Then
                fType = "MIDI"
              ElseIf myFileInfo.Extension = ".jpg" Then
                fType = "JPG"
              End If
              LI.SubItems.Add(fType)
              LI.SubItems.Add("Unknown")
              LI.SubItems.Add(myFileInfo.FullName)
            End If
          Next
    
    2010年12月24日 下午 12:50

解答

所有回覆