22-02-24, 05:30 PM
كود :
Imports WIA
Public Class Form1
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
LoadScanners()
End Sub
Private Sub LoadScanners()
' Create a new DeviceManager
Dim manager As New DeviceManager()
' Get the list of available devices
Dim devices As Devices = manager.DeviceInfos
' Clear existing items in ComboBox
ComboBox1.Items.Clear()
' Iterate through each device and add its name to the ComboBox
For Each deviceInfo As DeviceInfo In devices
ComboBox1.Items.Add(deviceInfo.Properties("Name").Value)
Next
' Select the first item by default
If ComboBox1.Items.Count > 0 Then
ComboBox1.SelectedIndex = 0
End If
End Sub
End Classلتحميل الماسحات الضوئية المتصلة بجهاز الكمبيوتر الخاص بك في ComboBox في VB.NET، يمكنك استخدام مكتبة WIA (Windows Image Acquisition).

