Reputation: 148
i have this problem, i created an application that play videos but this video haven't extension , so per example i have video like
big_buck_bunny
instead a file like :
big_buck_bunny.mp4
I cant convert this video. There is a way to play a video from remote without extension? I have a url like :
D:\\Software\\Marmotta\\marmotta-home\\resources\\88\\95\\43\\big_buck_bunny
Thanks all for help
Upvotes: 2
Views: 262
Reputation: 127553
You can use Directory.GetFiles
to get all files in a folder filtered to your filename. Be sure to include using System.IO;
at thte top of the file.
var path = "D:\\Software\\Marmotta\\marmotta-home\\resources\\88\\95\\43\\big_buck_bunny"
var directory = Path.GetDirectoryName(path);
var filename = Path.GetFileName(path);
string[] files = Directory.GetFiles(directory, filename + ".*", SearchOption.TopDirectoryOnly);
the array files
will hold a list of all the files in the folder that started with the name big_buck_bunny
, one of those files will be the one you want to use.
Upvotes: 0
Reputation:
What about adding the extension at the end of the file?
String path = "D:\\Software\\Marmotta\\marmotta-home\\resources\\88\\95\\43\\big_buck_bunny";
path += @".mp4";
Upvotes: 0