使用nreco.videoconverter进行转换后,如何获得结果文件名,我的要求是将文件路径保存到数据库中
var converter = new NReco.VideoConverter.FFMpegConverter();
converter.ConvertMedia(file, Path.Combine(filepath,Path.GetFileName(file).Split('.')[0]) + ".mp4", "mp4");
SqlCommand cmd = new SqlCommand();
cmd.Connection = con;
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "sp_videofilepathupdate";
cmd.Parameters.AddWithValue("@path",);
con.Open();
cmd.ExecuteNonQuery();
con.Close();
我试图传递<Path.GetFileName(file).Split('。')[0])+“ .mp4”>,但它保存了旧文件名本身,即file.flv,但转换后的文件名保存到本地文件夹是file.mp4。我如何才能实现将其保存到数据库。提前致谢..
我必须将尝试的名称传递给foldername。
`cmd.Parameters.AddWithValue("@path",@"Uploads/"+Path.GetFileName(file).Split('.')[0]+".mp4");
`
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句