←Select platform

FileName Property

Summary
Gets or sets the file name to use when transferring data from the current TWAIN source. This property is valid only if the TransferMode property is set to TwainTransferFile.

Syntax
C#
C++/CLI
Python
public string FileName { get; set; } 
public: 
property String^ FileName { 
   String^ get(); 
   void set (    String^ ); 
} 
FileName # get and set (TwainTransferOptions) 

Property Value

The file name to use when transferring data from the current TWAIN source. This property is valid only if the TransferMode property is set to TwainTransferFile.

Remarks

Gets or sets the file name to use when transferring data from the current TWAIN source. This property is valid only if the TransferMode property is set to TwainTransferFile. To update this property with the current value, call the TransferOptions property. To set the file name, assign a new value to this property and call the TransferOptions property.

Example
C#
using Leadtools; 
using Leadtools.Twain; 
 
 
public void TransferOptionsPropertyExample(IntPtr parent) 
{ 
   TwainSession session = new TwainSession(); 
   session.Startup(parent, "manufacturer", "productFamily", "version", "application", TwainStartupFlags.None); 
 
   TwainTransferOptions opts = session.TransferOptions; 
 
   opts.TransferMode = TwainTransferMode.File; 
   opts.FileName = Path.Combine(LEAD_VARS.ImagesDir, "test.bmp"); 
   opts.FileFormat = RasterImageFormat.Bmp; 
   opts.CompressionMode = TwainCompressionMode.None; 
 
   session.TransferOptions = opts; 
 
   if (session.IsTransferModeAvailable(TwainTransferMode.File)) 
      MessageBox.Show("File transfer is supported"); 
 
   if (session.IsTransferModeAvailable(TwainTransferMode.Buffer)) 
      MessageBox.Show("Memory transfer is supported"); 
 
   if (session.IsTransferModeAvailable(TwainTransferMode.Native)) 
      MessageBox.Show("Native transfer is supported"); 
 
   session.Shutdown(); 
} 
 
static class LEAD_VARS 
{ 
   public const string ImagesDir = @"C:\LEADTOOLS23\Resources\Images"; 
} 
Requirements

Target Platforms

Help Version 23.0.2024.2.29
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2024 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Twain Assembly
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.