Public Sub ElementHost1_Dragdrop(sender As Object, e As Forms.DragEventArgs) Handles ElementHost1.DragDrop If e.Data.GetDataPresent(DataFormats.FileDrop) Then Dim filePaths As String() = CType(e.Data.GetData(DataFormats.FileDrop), String()) For Each filePath As String In filePaths Dim MyDuration As String = GetDuration(filePath) Dim chkExt As String = _ My.Computer.FileSystem.GetFileInfo(filePath).Extension 'I'M STILL LEARNING SO PLEASE DON'T CRITISIZE ME TO BAD.... 'THIS IS THE ONLY METHOD THAT I KNOW HOW TO CALCULATE THE FILE SIZE.... Dim chkSize As String = _ My.Computer.FileSystem.GetFileInfo(filePath).Length chkSize = chkSize / 1024 'THIS IS WHAT I USED TO ROUND THE SIZE TO 2 DECIMAL POINTS... Dim d As Decimal d = Decimal.Round(chkSize, 2, MidpointRounding.AwayFromZero) 'THIS WILL ADD THE FILEPATHS AND THE FILES SIZE TO THE LIST VIEW 'LI = myplaylist.Items.Add(filePath) 'LI.StateImageIndex = 0 'LI.SubItems.Add(d & " kb") objItem = myplaylist.Items.Add(filePath) objItem.SubItems.Add(My.Computer.FileSystem.GetFileInfo(filePath).Name) objItem.SubItems.Add(MyDuration) Dim objMP3V1 As New MP3ID3v1(filePath) If (objMP3V1.TagExists) Then objItem.SubItems.Add(objMP3V1.Frame(MP3ID3v1.FrameTypes.Album)) ' MessageBox.Show(objMP3V1.Frame(MP3ID3v1.FrameTypes.Album)) ' MessageBox.Show(objMP3V1.Frame(MP3ID3v1.FrameTypes.Artist)) End If Next filePath End If
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)