Leadtools.Twain Send comments on this topic. | Back to Introduction - All Topics | Help Version 16.5.9.25
Shutdown Method
See Also  Example
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 Startup method. For each call to the 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 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also