我正在尝试使用 C# 加入几个 .wmv 文件.....以下是我的编码.....编码工作正常,它将所有 .wmv 文件读取和写入到流中.....但是,当我用我的 windows 媒体播放器播放加入的视频时,第一个视频只播放.....假设有 5 个 20 mb 的视频文件......在我加入它们后,文件大小变为 100 mb .. ..但是,当我播放它时,第一个视频只播放......但是,我需要播放整个视频....我该怎么办?
private void JoinFiles(string FolderInputPath, string FileOutputPath)
{
// Needed to get all files in that directory
DirectoryInfo diSource = new DirectoryInfo(FolderInputPath);
// Filestream to reconstruct the file
FileStream fsSource = new FileStream(FileOutputPath, FileMode.Append);
// Loop through all the files with the *.part extension in the folder
foreach (FileInfo fiPart in diSource.GetFiles(@"*.wmv"))
{
// Create a byte array of the content of the current file
Byte[] bytePart = System.IO.File.ReadAllBytes(fiPart.FullName);
// Write the bytes to the reconstructed file
fsSource.Write(bytePart, 0, bytePart.Length);
}
fsSource.Close();
// Close the file stream
}