我希望能够从我的(C#)应用程序中打开Windows Live Writer,并且已经开始填写博客文章。Windows Live Writer自动化
这应该很简单。 Windows Live Writer定义了一个Application API,它公开了一个名为WindowsLiveWriterApplicationLib的COM接口。根据this等博客文章,在向typelib添加新引用(通常位于此处:C:\ Program Files(x86)\ Windows Live \ Writer \ WindowsLiveWriter.Application.tlb)之后,您应该能够编写代码像这样:
static void Main(string[] args)
{
var wlw = new WindowsLiveWriterApplicationLib.WindowsLiveWriterApplicationClass();
wlw.BlogThisHtml("test","test");
}
...除非它不工作。不事件编译。相反,我得到的错误是这样的:
Error 1 The type 'WindowsLiveWriterApplicationLib.WindowsLiveWriterApplicationClass' has no constructors defined
Error 2 Interop type 'WindowsLiveWriterApplicationLib.WindowsLiveWriterApplicationClass' cannot be embedded. Use the applicable interface instead.
Error 3 'WindowsLiveWriterApplicationLib.WindowsLiveWriterApplicationClass' does not contain a definition for 'BlogThisHtml' and no extension method 'BlogThisHtml' accepting a first argument of type 'WindowsLiveWriterApplicationLib.WindowsLiveWriterApplicationClass' could be found (are you missing a using directive or an assembly reference?)
它声称的类不能被嵌入,有没有构造,并且不包含我打电话的方法。 (当它在对象资源管理器中清楚地实现时)。
我在这里丢失了什么明显的东西?
为什么downvote? –