简体   繁体   English

如何覆盖/替换Microsoft基本编码器文件?

[英]How to override/replace microsoft essential encoder file?

Using encoder ( Link ), To record video which is playing on screen for Selenium automation script. 使用编码器( Link ),录制Selenium自动化脚本在屏幕上播放的视频。

 ScreenCaptureJob scj = new ScreenCaptureJob();
 scj.OutputScreenCaptureFileName = "XXX.avi";
 scj.Start();

It is required to delete existing file, before to write .avi file on existing name. 必须先删除现有文件,然后才能使用现有名称写入.avi文件。

Is it possible to replace existing file Or override it ? 是否可以替换现有文件或覆盖它?

You can try deletion of file before saving it: 您可以先尝试删除文件再保存:

try {
    Files.deleteIfExists(Paths.get("PATH TO FILE\"XXX.avi"));
} catch (IOException e) {
    e.printStackTrace();
}

With reference to C# utility, Implemented as: 参考C#实用程序,实现为:

if (File.Exists(path))
{
File.Delete(path);
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM