• C# 获取mp3文件的歌曲时间长度


    添加命名空间:
        using Shell32;
        using System.Text.RegularExpressions;
    添加引用:COM组件的Microsoft Shell Controls And Automation

    string dirName = Path.GetDirectoryName(SongPath);
    SongName = Path.GetFileName(SongPath);//获得歌曲名称
    FileInfo fInfo = new FileInfo(SongPath);
    ShellClass sh = new ShellClass();
    Folder dir = sh.NameSpace(dirName);
    FolderItem item = dir.ParseName(SongName);
    SongTime = Regex.Match(dir.GetDetailsOf(item, -1), "\d:\d{2}:\d{2}").Value;//获取歌曲时间
     
  • 相关阅读:
    MySQL Connection排查未授权用户(unauthenticated user)
    Git常用命令
    abc
    更新显卡驱动
    财务模块 采购、接收、应付会计分录和功能认识
    ebs界面颜色改变
    获取科目的描述 创建科目
    EBS总账(GL)模块常用表
    收款 付款 到总帐
    PO收料到入库的分析
  • 原文地址:https://www.cnblogs.com/yechangzhong-826217795/p/7100080.html
Copyright © 2020-2023  润新知