02-10-17, 01:14 AM
بسم الله الرحمن الرحيم
نعمل مشروع جديد ونضيف فيه ListBox1
وهذا كود المشروع كامل
كود :
المصدر هــنــا
المشروع في المرفقات
قمت بتجربته على ويندوز 10
وهذا كود المشروع كامل
كود :
كود :
Imports Microsoft.Win32
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim _RegistryKey As RegistryKey = Registry.LocalMachine.OpenSubKey("SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList")
For Each _KeyName As String In _RegistryKey.GetSubKeyNames()
Using SubKey As RegistryKey = _RegistryKey.OpenSubKey(_KeyName)
Dim _Users As String = DirectCast(SubKey.GetValue("ProfileImagePath"), String)
Dim _Username As String = System.IO.Path.GetFileNameWithoutExtension(_Users)
ListBox1.Items.Add(_Username)
ListBox1.Items.Remove("systemprofile")
ListBox1.Items.Remove("LocalService")
ListBox1.Items.Remove("NetworkService")
ListBox1.Items.Remove("DefaultAppPool")
End Using
Next
End Sub
End Classالمصدر هــنــا
المشروع في المرفقات
قمت بتجربته على ويندوز 10