VintaSoft Twain .NET SDK 15.0: Documentation for .NET developer
Vintasoft.WpfTwain Namespace / Device Class / SaveSettings(Stream) Method
Syntax Exceptions Remarks Example Requirements SeeAlso
In This Topic
    SaveSettings(Stream) Method (Device)
    In This Topic
    Saves the current device settings to the stream.
    Syntax
    'Declaration
    
    Public Sub SaveSettings( _
    ByVal stream
    Stream to save the device settings.
    As System.IO.Stream _
    )
    public void SaveSettings(
    System.IO.Stream stream
    )
    public: void SaveSettings(
    System.IO.Stream* stream
    )
    public:
    void SaveSettings(
    System.IO.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 C#/VB.NET code shows how to save the current device settings to a file.

    
    Public Sub SaveSettings(device As Vintasoft.Twain.Device)
            device.Open()
            Using fs As New System.IO.FileStream("scanner-setup.xml", System.IO.FileMode.Append, System.IO.FileAccess.Write)
                    device.SaveSettings(fs)
            End Using
    End Sub
    
    
    
    public void SaveSettings(Vintasoft.Twain.Device device)
    {
        device.Open();
        using (System.IO.FileStream fs = new System.IO.FileStream("scanner-setup.xml", System.IO.FileMode.Append, System.IO.FileAccess.Write))
        {
            device.SaveSettings(fs);
        }
    }
    
    

    Requirements

    Target Platforms: .NET 8, .NET 7; .NET 6; .NET Framework 4.8, 4.7, 4.6, 4.5, 4.0, 3.5

    See Also