Private Function show_progress(ByVal cname As String, ByVal x As Integer, ByVal y As Integer)
Dim p1 As New ProgressBar
Dim myConnectionOptions As New System.Management.ConnectionOptions
With myConnectionOptions
.Authentication = System.Management.AuthenticationLevel.Connect
.Authentication = System.Management.AuthenticationLevel.PacketPrivacy
End With
Dim strComputer = cname
Dim colItems As ManagementScope
colItems = New ManagementScope("\\" & strComputer & "\root\CIMV2\Security\MicrosoftVolumeEncryption", myConnectionOptions)
colItems.Connect()
If colItems.IsConnected = False Then
MsgBox("Could not connect to WMI namespace")
End If
Dim query As ObjectQuery
query = New ObjectQuery( _
"SELECT * FROM Win32_EncryptableVolume")
Dim searcher As ManagementObjectSearcher
searcher = _
New ManagementObjectSearcher(colItems, query)
Dim queryCollection As ManagementObjectCollection
queryCollection = searcher.Get()
Dim m As ManagementObject
For Each m In queryCollection
Dim ConversionStatus As ManagementBaseObject = m.InvokeMethod("GetConversionStatus", Nothing, Nothing)
Label1.Text = ConversionStatus("EncryptionPercentage").ToString & "%"
' ProgressBar1.Value = ConversionStatus("EncryptionPercentage")
p1.Size = New Size(242, 24)
p1.Location = New Point(x, y)
p1.Value = ConversionStatus("EncryptionPercentage")
p1.Visible = True
p1.Show()
Controls.Add(p1)
Next
End Function
Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.
When asked, what has been your best career decision?
Deciding to stick with EE.
Being involved with EE helped me to grow personally and professionally.
Connect with Certified Experts to gain insight and support on specific technology challenges including:
We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE