VintaSoft Twain .NET SDK 15.3: Руководство для .NET разработчика
Vintasoft.WinTwain Namespace / Device Class / LoadSettings Methods / LoadSettings(Stream) Method
Синтаксис Exceptions Ремарки Example Требования Смотрите также
В этом разделе
    LoadSettings(Stream) Метод (Device)
    В этом разделе
    Loads device settings from the stream.
    Синтаксис
    'Declaration
    
    Public Overloads Sub LoadSettings( _
    ByVal stream
    Stream with device settings.
    As System.IO.Stream _
    )
    public void LoadSettings(
    System.IO.Stream stream
    )
    public: void LoadSettings(
    System.IO.Stream* stream
    )
    public:
    void LoadSettings(
    System.IO.Stream^ stream
    )

    Parameters

    stream
    Stream with device settings.
    Исключения
    ИсключениеОписание
    Thrown if stream is null.
    Thrown if stream does not have read 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.
    Ремарки

    Call this method only when device is opened (State == DeviceState.Opened).

    Пример

    This C#/VB.NET code shows how to load previously saved device settings into the device.

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

    Требования

    Целевые платформы: .NET 9; .NET 8; .NET 7; .NET 6; .NET Framework 4.8, 4.7, 4.6, 4.5, 4.0, 3.5

    Смотрите также