如何为视频提供相对路径 [英] How Do I Give A Relative Path For The Video

查看:101
本文介绍了如何为视频提供相对路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 newVideo.YouTubeEntry.MediaSource =  new  MediaFileSource(imgpath,  video / mp4); 







在上面的代码中,路径从c\programfiles; \\ iis开始...

但该文件实际上在桌面上,如果我将视频保存到应用程序并使用server.mappath

解决方案

< blockquote>因为这是C#代码,您必须将其保存到服务器,而不能从客户端运行它。 Server.MapPath是正确的方法,但它必须在服务器上。


newVideo.YouTubeEntry.MediaSource = new MediaFileSource(imgpath,"video/mp4");




in the above code the path starts from c\programfiles\iis...
but the file is actually on the desktop,andit aorks if i save the video to the application and use server.mappath

解决方案

Because this is C# code you have to save it to the server and you can't run it from the client. Server.MapPath is the correct approach but it has to be on the server.


这篇关于如何为视频提供相对路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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