LEADTOOLS OCR (Leadtools.Forms.Ocr assembly) Send comments on this topic. | Back to Introduction - All Topics | Help Version 17.0.3.29
WorkDirectory Property
See Also 
Leadtools.Forms.Ocr Namespace > IOcrEngine Interface : WorkDirectory Property



The WorkDirectory Property is available as an add-on to the LEADTOOLS Document and Medical Imaging toolkits.

Gets the path to the work directory used by this IOcrEngine to store the engine temporary files.

Syntax

Visual Basic (Declaration) 
ReadOnly Property WorkDirectory As String
Visual Basic (Usage)Copy Code
Dim instance As IOcrEngine
Dim value As String
 
value = instance.WorkDirectory
C# 
string WorkDirectory {get;}
C++/CLI 
property String^ WorkDirectory {
   String^ get();
}

Property Value

The path to the work directory used by this IOcrEngine to store the engine temporary files.

Example

For an example, refer to Startup.

Remarks

The Leadtools.Forms.Ocr.IOcrEngine.WorkDirectory is passed as the workDirectory parameter to the Startup method. This directory is used when the engine saves the its temporary files. The IOcrEngine object will create various temporary files during recognition and document saving processes. It will use the path passed in Leadtools.Forms.Ocr.IOcrEngine.WorkDirectory as the location where these temporary files will be created. You can pass null (Nothing in Visual Basic) to let the engine select the temporary directory of the current logged in user (TEMP).

In either case, the value of working directory of the current started IOcrEngine can be obtained through the Leadtools.Forms.Ocr.IOcrEngine.WorkDirectory property.

The engine will automatically deletes any temporary files created. However, if an unexpected error occurs (for example, an unhandled exception), some temporary files may still reside in the work directory after the application exits. A typical application may use a custom directory inside the application path and manually deletes any files that may reside there before calling Startup in case the previous instance of the application exited abnormally.

If the value of Leadtools.Forms.Ocr.IOcrEngine.WorkDirectory is not null (Nothing in Visual Basic), then it must refer to a valid directory that exists in the system and the process that created the engine must have access rights to read, write and delete files from this directory.

The value Leadtools.Forms.Ocr.IOcrEngine.WorkDirectory will hold the current work directory used by the OCR engine, if you passed null (Nothing in Visual Basic) in the Startup method, the value of this property will be set to the current logged in user TEMP value.

Requirements

Target Platforms: Microsoft .NET Framework 2.0, Windows 2000, Windows XP, Windows Server 2003 family, Windows Server 2008 family, Windows Vista, Windows 7

See Also

WorkDirectory requires an OCR module license and unlock key. For more information, refer to: Imaging Pro/Document/Medical Features