我如何在Mvc 4获得持续时间(Flv)? [英] How I Get Duration (Flv) At Mvc 4?

查看:81
本文介绍了我如何在Mvc 4获得持续时间(Flv)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何获得mvc-4的持续时间?



i阅读所有帖子,但我不能添加一些dll,而且一些dll不起作用。



现在我正在使用:



来自

How i get duration at mvc-4 ??

i read all of posts , but i cant add some of dlls and some of dlls do not work .

now i am using:

from

Microsoft.WindowsAPICodePack.Shell

Microsoft.WindowsAPICodePack.Shell.PropertySystem

这些命名空间只给我mp-3的持续时间。但是没有得到持续时间* .flv。此代码适用于mp3:

these namespace get me just duration of mp-3 . but do not get duration *.flv. This code is for mp3 :

using Microsoft.WindowsAPICodePack.Shell;
using Microsoft.WindowsAPICodePack.Shell.PropertySystem;

public static double Convert100NanosecondsToMilliseconds(double nanoseconds)
{
    return nanoseconds * 0.0001;
}



以下代码在我的行动中:


below code is in my action :

var fle = "Path of mp3";
ShellFile so = ShellFile.FromFilePath(fle);
double nanoseconds;
double.TryParse(so.Properties.System.Media.Duration.Value.ToString(), out nanoseconds);
if (nanoseconds > 0 )
{
    double seconds = Convert100NanosecondsToMilliseconds(nanoseconds) / 1000;
    double time = Math.Round(seconds / 60, 1);
    string res = time.ToString();
}



我的视觉工作室是2013年。

我的窗户是8。


my visual studio is 2013 .
my windows is 8 .

推荐答案

请参阅此处 [ ^ ]


这篇关于我如何在Mvc 4获得持续时间(Flv)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆