TwainPRO 9 for .NET - User Guide > How To > Open a TWAIN Session > Select a Data Source |
The Data Source for the TWAIN session must now be identified.
The Data Source should be set before opening a TWAIN session (TwainDevice.OpenSession). |
To enable the application end user to select a Data Source using the Data Source Manager's User Interface, call TwainDevice.SelectSource. The DataSource Manager's UI will display with the default Data Source highlighted. The user selects the Data Source he or she wishes to use then selects the OK or Cancel buttons.
TwainPRO™ can retrieve the list of Data Sources (DS) on the current system and set the current Data Source, without using the DSM User Interface.
In order to obtain a list of the Data Sources you must call the OpenDataSourceManager method first. You can then create a DataSourceCollection which is filled with a list of all Data Source product names. The Count property of the DataSourceCollection can be used to get the number of Data Source product names within the DataSourceCollection. The Current property of the DataSourceCollection can be used to get or set the index of the currently selected Data Source.