VintaSoft Twain .NET SDK v10.2
SaveSettings Method (Device)
Example 




Vintasoft.WpfTwain Namespace > Device Class : SaveSettings Method
Stream to save the device settings.
Saves the current device settings to the steram.
Syntax
'Declaration
 
Public Sub SaveSettings( _
   ByVal stream As Stream _
) 
'Usage
 
Dim instance As Device
Dim stream As Stream
 
instance.SaveSettings(stream)
public void SaveSettings( 
   Stream stream
)
public: void SaveSettings( 
   Stream* stream
) 
public:
void SaveSettings( 
   Stream^ stream
) 

Parameters

stream
Stream to save the device settings.
Exceptions
ExceptionDescription
Thrown if stream is null.
Thrown if stream does not have write access.
Thrown if device is in wrong state.
Thrown if device does not support profiles with settings.
Thrown if the .NET debugger is used and the function evaluation requires all threads to run.
Remarks
Call this method only when device is opened (State == DeviceState.Opened).
Example
This example shows how to save the current device settings to a file.
Public Sub SaveSettings(ByVal device As Device)
    device.Open()
    Using fs As New FileStream("scanner-setup.xml", FileMode.Append, FileAccess.Write)
        device.SaveSettings(fs)
    End Using
End Sub
public void SaveSettings(Device device)
{
    device.Open();
    using (FileStream fs = new FileStream("scanner-setup.xml", FileMode.Append, FileAccess.Write))
    {
        device.SaveSettings(fs);
    }
}
Requirements

Target Platforms: Windows 8, Windows 7, Windows Vista, Windows XP, Windows Server 2012, Windows Server 2008, Windows Server 2003

See Also

Reference

Device Class
Device Members
LoadSettings Method