Leadtools TWAIN (Leadtools.Twain assembly) Send comments on this topic. | Back to Introduction - All Topics | Help Version 17.0.3.30
QueryFileSystem Method
See Also 
Leadtools.Twain Namespace > TwainSession Class : QueryFileSystem Method



fileSystem
TwainFileSystem contains file system information
message
Determines the Twain file system message.
fileSystem
TwainFileSystem contains file system information
message
Determines the Twain file system message.
Query Twain file system.

Syntax

Visual Basic (Declaration) 
Public Sub QueryFileSystem( _
   ByVal fileSystem As TwainFileSystem, _
   ByVal message As TwainFileSystemMessage _
) 
Visual Basic (Usage)Copy Code
Dim instance As TwainSession
Dim fileSystem As TwainFileSystem
Dim message As TwainFileSystemMessage
 
instance.QueryFileSystem(fileSystem, message)
C# 
public void QueryFileSystem( 
   TwainFileSystem fileSystem,
   TwainFileSystemMessage message
)
C++/CLI 
public:
void QueryFileSystem( 
   TwainFileSystem^ fileSystem,
   TwainFileSystemMessage message
) 

Parameters

fileSystem
TwainFileSystem contains file system information
message
Determines the Twain file system message.

Return Value

A TwainFileSystem object that represents the specified Twain file system message

Example

Visual BasicCopy Code
Public Sub QueryFileSystemExample(ByVal parent As IWin32Window)
   Dim session As TwainSession = New TwainSession()
   Dim fileSystem As TwainFileSystem = New TwainFileSystem()
   Dim msg As String

   Try
      session.Startup(parent, "manufacturer", "productFamily", "version", "application", TwainStartupFlags.None)
      session.QueryFileSystem(fileSystem, TwainFileSystemMessage.AutomaticCaptureDirectory)

      ' I changed the following line from "fileSystem.FileType" to "fileSystem.FileFormat"
      msg = String.Format("Input Name = {0}" & Constants.vbLf & "Output Name = {1}" & Constants.vbLf & "Recursive = {2}" & Constants.vbLf & "FileType = {3}" & Constants.vbLf & "FileSize = {4}" & Constants.vbLf & "CreateTimeDate = {5}" & Constants.vbLf & "ModifiedTimeDate = {6}" & Constants.vbLf & "FreeMediaSpace = {7}" & Constants.vbLf & "NewImageSize = {8}" & Constants.vbLf & "NumberOfFiles = {9}" & Constants.vbLf & "NumberOfAudioSnippets = {10}" & Constants.vbLf & "DeviceGroupMask = {11}" & Constants.vbLf, fileSystem.InputName, fileSystem.OutputName, fileSystem.Recursive, fileSystem.FileFormat, fileSystem.FileSize, fileSystem.CreateTimeDate, fileSystem.ModifiedTimeDate, fileSystem.FreeSpace, fileSystem.NewImageSize, fileSystem.NumberOfFiles, fileSystem.NumberOfAudioSnippets, fileSystem.DeviceGroupMask)

      MessageBox.Show(msg)
   Catch ex As Exception
      MessageBox.Show(ex.Message)
   Finally
      session.Shutdown()
   End Try
End Sub
C#Copy Code
public void QueryFileSystemExample(IWin32Window parent)
{
   TwainSession session = new TwainSession();
   TwainFileSystem fileSystem = new TwainFileSystem();
   string msg;

   try
   {
      session.Startup(parent, "manufacturer", "productFamily", "version", "application", TwainStartupFlags.None);
      session.QueryFileSystem(fileSystem, TwainFileSystemMessage.AutomaticCaptureDirectory);

      msg = String.Format("Input Name = {0}\nOutput Name = {1}\nRecursive = {2}\nFileType = {3}\nFileSize = {4}\nCreateTimeDate = {5}\nModifiedTimeDate = {6}\nFreeMediaSpace = {7}\nNewImageSize = {8}\nNumberOfFiles = {9}\nNumberOfAudioSnippets = {10}\nDeviceGroupMask = {11}\n",
         fileSystem.InputName,
         fileSystem.OutputName,
         fileSystem.Recursive,
         // I changed the following line from "fileSystem.FileType" to "fileSystem.FileFormat"
         fileSystem.FileFormat,
         fileSystem.FileSize,
         fileSystem.CreateTimeDate,
         fileSystem.ModifiedTimeDate,
         fileSystem.FreeSpace,
         fileSystem.NewImageSize,
         fileSystem.NumberOfFiles,
         fileSystem.NumberOfAudioSnippets,
         fileSystem.DeviceGroupMask);

      MessageBox.Show(msg);
   }
   catch (Exception ex)
   {
      MessageBox.Show(ex.Message);
   }
   finally
   {
      session.Shutdown();
   }
}

Remarks

This method will query Twain file system for digital cameras. And update the Twain file system upon the passed message to fileSystemMsg parameters.

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