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

    Parameters

    stream
    Stream with current values of capabilites.
    Исключения
    ИсключениеОписание
    Thrown if stream is null (Nothing in VB).
    Thrown if stream does not support reading.
    Thrown if device is in wrong state.
    Thrown if device does not support capability.
    Thrown if the .NET debugger is used and the function evaluation requires all threads to run.
    Пример

    This C#/VB.NET code shows how to load previously saved values of device capabilities.

    
    ''' <summary>
    ''' Loads the device capability collection from file.
    ''' </summary>
    ''' <param name="device"></param>
    Public Shared Sub LoadDeviceCapabilityCollection(device As Vintasoft.Twain.Device)
        ' open the device
        device.Open()
        ' open file
        Using fs As New System.IO.FileStream("scanner-capabilities.xml", System.IO.FileMode.Open, System.IO.FileAccess.Read)
            ' load the device capability collection from file
            device.Capabilities.Load(fs)
        End Using
    End Sub
    
    
    
    /// <summary>
    /// Loads the device capability collection from file.
    /// </summary>
    /// <param name="device"></param>
    public static void LoadDeviceCapabilityCollection(Vintasoft.Twain.Device device)
    {
        // open the device
        device.Open();
        // open file
        using (System.IO.FileStream fs = new System.IO.FileStream("scanner-capabilities.xml", System.IO.FileMode.Open, System.IO.FileAccess.Read))
        {
            // load the device capability collection from file
            device.Capabilities.Load(fs);
        }
    }
    
    

    Требования

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

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