ABBYY Flexicapture에서 일부 스크립트를 C# .NET으로 작성하도록하고 있습니다. C# .NET은 사용하지 않지만 필자가 사용하는 Java에 충분히 근접합니다. 나는 다음과 같은 표시하는 method
선언이 있습니다메소드 정의에서 VARIANT라는 용어는 무엇을 의미합니까?
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
이 사용 된 것을 본 적이 없지만 누군가이 설명을 해줄 수 있습니까? 임 누락 된 구문 오류가 있습니까?
개체 s = Document.Property ("CreatedBy") ;? – Vlad
string = Document.Property ("CreatedBy"); // Returns Error : 암시 적으로 'object'유형을 'string'으로 변환 할 수 없습니다. 이 오류 메시지는 Document.Property ("CreatedBy")가 개체임을 나타냅니다. – sgmoore
@Vlad - 고마워, 그게 다야. 그럼 내가'.ToString()'을 변환하고 모든 것이 잘 작동했다. – ProfessionalAmateur