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



Ends a TWAIN session.

Syntax

Visual Basic (Declaration) 
Public Sub Shutdown() 
Visual Basic (Usage)Copy Code
Dim instance As TwainSession
 
instance.Shutdown()
C# 
public void Shutdown()
C++/CLI 
public:
void Shutdown(); 

Example

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

   Dim twCap As TwainCapability = New TwainCapability()

   twCap.Information.Type = TwainCapabilityType.ImageTransferMechanism
   twCap.Information.ContainerType = TwainContainerType.OneValue
   twCap.OneValueCapability.ItemType = TwainItemType.Uint16
   twCap.OneValueCapability.Value = TwainCapabilityValue.TransferMechanismNative

   session.SetCapability(twCap, TwainSetCapabilityMode.Set)
   session.Acquire(TwainUserInterfaceFlags.Show)
   session.Shutdown()
End Sub
C#Copy Code
public void ShutdownExample(IWin32Window parent)
{
   TwainSession session = new TwainSession();
   session.Startup(parent, "manufacturer", "productFamily", "version", "application", TwainStartupFlags.None);

   TwainCapability twCap = new TwainCapability();

   twCap.Information.Type = TwainCapabilityType.ImageTransferMechanism;
   twCap.Information.ContainerType = TwainContainerType.OneValue;
   twCap.OneValueCapability.ItemType = TwainItemType.Uint16;
   twCap.OneValueCapability.Value = TwainCapabilityValue.TransferMechanismNative;

   session.SetCapability(twCap, TwainSetCapabilityMode.Set);
   session.Acquire(TwainUserInterfaceFlags.Show);
   session.Shutdown();
}

Remarks

A TWAIN session is started by calling the Leadtools.Twain.TwainSession.Startup method. For each call to the Leadtools.Twain.TwainSession.Startup method there must be a call to the Shutdown method.
For more information, refer to Freeing the TWAIN Session.

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