我在 ABBYY Flexicapture 中工作,它允许用 C#.NET 编写一些脚本,我从来没有使用过 C#.NET,但它与 Java 已经足够接近了。我有一个method
声明,显示以下内容:
Document:
Property (name: string) : VARIANT
Description: Retrieves the value of a specified property by its name. The returned value can be in the form of a string, a number or time.
Properties names and returned values:
Exported - when the document was exported
ExportedBy - who exported the document
Created - when the document was created
CreatedBy - who created the document
因此,我试图获取“导出者”值,但是当我尝试以下任何行时,我会收到错误:
string = Document.Property("CreatedBy"); // Returns Error: Cannot implicitly convert type 'object' to 'string'. An explicit conversion exists (are you missing a cast?) (line 95, pos 21)
string = Document.Property(CreatedBy); // Returns Error: Error: The name 'CreatedBy' does not exist in the current context (line 95, pos 39)
string = Document.Property("CreatedBy").Text; //Error: 'object' does not contain a definition for 'Text' (line 95, pos 52
我以前从未见过VARIANT
使用过的,有人可以向我解释一下。我缺少明显的语法错误吗?