Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Wednesday, October 6, 2021 11:03:17 AM(UTC)

crw  
crw

Groups: Registered
Posts: 1


Hello,

I am trying to retrieve the serial number of my scanner.
My scanner is capable of providing the serial number.

I have tried the following code but i am not getting the result i am needing.

Im coding in C#

Quote:
strSerialNumber = _twainSession.GetCapability(TwainCapabilityType.SerialNumber, TwainGetCapabilityMode.GetDefault).ToString();

System.Windows.MessageBox.Show(strSerialNumber);


I am getting Leadtools.Twain.TwainCapability as the result in my messagebox.
 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Tuesday, October 19, 2021 7:35:02 AM(UTC)

Hadi  
Hadi

Groups: Manager, Tech Support, Administrators
Posts: 218

Was thanked: 12 time(s) in 12 post(s)

Hello,

You need to know the type of capability it is and then access the value of that like so:

Code:
    var cap = _twainSession.GetCapability(TwainCapabilityType.SerialNumber, TwainGetCapabilityMode.GetDefault);
         var strSerialNumber = cap.OneValueCapability.Value.ToString();
         MessageBox.Show(strSerialNumber);


More information can be found here:
https://www.leadtools.co.../tw/twaincapability.html
https://www.leadtools.co...nonevaluecapability.html
Hadi Chami
Developer Support Manager
LEAD Technologies, Inc.

LEAD Logo
 
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2024, Yet Another Forum.NET
This page was generated in 0.058 seconds.