我应该将哪个引用添加到我的 WPF 应用程序中,以便我可以实现 IQueryCancelAutoPlay 接口?
这是产生错误 的代码示例找不到类型或命名空间名称“IQueryCancelAutoPlay”(您是否缺少 using 指令或程序集引用?)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;
namespace DisableAutorun {
[ComVisible(true)]
[Guid("63DA3B72-E9C9-4d40-B7DA-DC537C4C5CC2")]
[ClassInterface(ClassInterfaceType.None)]
public class Autoplay : IQueryCancelAutoPlay, IDisposable {
private RunningObjectTableEntry rotEntry;
public Autoplay() {
rotEntry = new RunningObjectTableEntry(this);
}
public int AllowAutoPlay(string pszPath, Content dwContentType, string pszLabel, int dwSerialNumber) {
Console.WriteLine("QueryCancelAutoPlay:");
Console.WriteLine(" " + pszPath);
Console.WriteLine(" " + dwContentType.ToString("x"));
Console.WriteLine(" " + pszLabel);
Console.WriteLine(" " + dwSerialNumber.ToString());
return 1;
}
}
}