c# - 如何在控制台应用程序中使用 Windows Burn-API
问题描述
我尝试使用控制台应用程序来处理来自 Windows Burning-API 的服务器功能。
当我尝试从 MsftDiscMaster2 获取 CD-ROM unique_Recorder_Id
/// Microsoft IMAPIv2 Disc Master ///
[ComImport]
[Guid("27354130-7F64-5B0F-8F00-5D77AFBE261E")]
[CoClass(typeof(MsftDiscMaster2Class))]
public interface MsftDiscMaster2 : IDiscMaster2 {}
我收到异常:
Could not load file or assembly 'CustomMarshalers, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.
该代码在 WinForm 应用程序上运行良好
MsftDiscMaster2 discMaster = new MsftDiscMaster2();
MsftDiscRecorder2 discRecorder = new MsftDiscRecorder2();
if (!discMaster.IsSupportedEnvironment)
return;
foreach (string uniqueRecorderId in discMaster) // This line throws the exp
{
discRecorder.InitializeDiscRecorder(uniqueRecorderId);
Console.WriteLine(discRecorder.VolumeName);
}
解决方案
推荐阅读
- javascript - 如何迭代具有迭代之间延迟的无限动画
- javascript - 基于输出文本在 CSS 中格式化文本
- visual-studio-code - VSCode 智能感知停止使用 js 模块导入
- javascript - 在悬停时更改添加到购物车文本
- r - dplyr中具有多个功能的行分析
- c# - 如何向我的用户角色表添加第三个属性?
- python - 在非数字上拆分字符串
- powershell - powershell 比较文件日期无法始终如一地工作
- python - 使用列表推导查找列表中的元素,其中另一个列表中的所有元素都是因子
- c# - MetadataType 和 Attribute.IsDefined