string strFileName = Server.MapPath("~/00125ca6293e6109161b6fa91d03473a.mp3"); string dirName = System.IO.Path.GetDirectoryName(strFileName); string SongName = System.IO.Path.GetFileName(strFileName);//获得歌曲名称 FileInfo fInfo = new FileInfo(strFileName); ShellClass sh = new ShellClass(); Folder dir = sh.NameSpace(dirName); FolderItem item = dir.ParseName(SongName); string timeStr = dir.GetDetailsOf(item, -1); Label1.Text = Regex.Match(timeStr, "\\d:\\d{2}:\\d{2}").Value;//获取歌曲时间 Label2.Text = timeStr;
时间: 2024-10-22 22:01:36