Leadtools.Twain Send comments on this topic. | Back to Introduction - All Topics | Help Version 16.5.9.25
QuerySourceInformation Method
See Also  Example
Leadtools.Twain Namespace > TwainSession Class : QuerySourceInformation Method



Gets information about the available TWAIN Data Sources.

Syntax

Visual Basic (Declaration) 
Public Function QuerySourceInformation() As TwainSourceInformation()
Visual Basic (Usage)Copy Code
Dim instance As TwainSession
Dim value() As TwainSourceInformation
 
value = instance.QuerySourceInformation()
C# 
public TwainSourceInformation[] QuerySourceInformation()
C++/CLI 
public:
array<TwainSourceInformation>^ QuerySourceInformation(); 

Example

Visual BasicCopy Code
Public Sub QuerySourceInformationExample(ByVal parent As IWin32Window)
   Dim buffer As String
   Dim session As TwainSession = New TwainSession()
   session.Startup(parent, "manufacturer", "productFamily", "version", "application", TwainStartupFlags.None)

   Dim srcInfo As TwainSourceInformation() = session.QuerySourceInformation()

   Dim i As Integer = 0
   Do While i < srcInfo.Length
      buffer = String.Format("Source Name = {0}" & Constants.vbLf & "Product Family Name = {1}" & Constants.vbLf & "Manufacturer Name = {2}" & Constants.vbLf, srcInfo(i).Name, srcInfo(i).ProductFamily, srcInfo(i).Manufacturer)

      MessageBox.Show(buffer)
      i += 1
   Loop
   session.Shutdown()
End Sub
C#Copy Code
public void QuerySourceInformationExample(IWin32Window parent) 

   string buffer; 
   TwainSession session = new TwainSession(); 
   session.Startup(parent, "manufacturer", "productFamily", "version", "application", TwainStartupFlags.None); 
 
   TwainSourceInformation[] srcInfo = session.QuerySourceInformation(); 
 
   for (int i=0; i < srcInfo.Length; i++) 
   { 
      buffer = String.Format("Source Name = {0}\nProduct Family Name = {1}\nManufacturer Name = {2}\n", 
         srcInfo[i].Name, srcInfo[i].ProductFamily, srcInfo[i].Manufacturer); 
 
      MessageBox.Show(buffer); 
   } 
   session.Shutdown(); 
}

Remarks

For more information, refer to Managing the TWAIN Source.

Requirements

Target Platforms: Microsoft .NET Framework 2.0, Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also