VintaSoft Twain .NET SDK 14.1: Руководство для .NET разработчика
В этом разделе
    Как установить значение параметров устройства для TWAIN сканера?
    В этом разделе
    Вот C#/VB.NET код, который демонстрирует, как включить режим двусторонней печати, используя возможности TWAIN устройства:

    private static void SetDuplexEnabledCapValue()
    {
        using (Vintasoft.Twain.DeviceManager deviceManager1 = new Vintasoft.Twain.DeviceManager())
        {
            // open the device manager
            deviceManager1.Open();
    
            // get reference to the default device
            Vintasoft.Twain.Device device = deviceManager1.DefaultDevice;
    
            // open the device
            device.Open();
    
            // get reference to object that manipulates DuplexEnabled capability
            Vintasoft.Twain.DeviceCapability duplexEnabledCap = device.Capabilities.Find(Vintasoft.Twain.DeviceCapabilityId.DuplexEnabled);
            // if DuplexEnabled capability supported
            if (duplexEnabledCap != null)
            {
                // set value of DuplexEnabled capability
                duplexEnabledCap.SetValue(true);
            }
    
            // close the device
            device.Close();
    
            // close the device manager
            deviceManager1.Close();
        }
    }
    
    Private Shared Sub SetDuplexEnabledCapValue()
            Using deviceManager1 As New Vintasoft.Twain.DeviceManager()
                    ' open the device manager
                    deviceManager1.Open()
    
                    ' get reference to the default device
                    Dim device As Vintasoft.Twain.Device = deviceManager1.DefaultDevice
    
                    ' open the device
                    device.Open()
    
                    ' get reference to object that manipulates DuplexEnabled capability
                    Dim duplexEnabledCap As Vintasoft.Twain.DeviceCapability = device.Capabilities.Find(Vintasoft.Twain.DeviceCapabilityId.DuplexEnabled)
                    ' if DuplexEnabled capability supported
                    If duplexEnabledCap IsNot Nothing Then
                            ' set value of DuplexEnabled capability
                            duplexEnabledCap.SetValue(True)
                    End If
    
                    ' close the device
                    device.Close()
    
                    ' close the device manager
                    deviceManager1.Close()
            End Using
    End Sub