Private Sub Code()
Try
Dim fs As New FileStream("C:\Mitio\Locked.log",
FileMode.Append)
Dim sw As New StreamWriter(fs)
ProgressBar1.Maximum = lb.Items.Count
For Each obj As Object In lb.Items
Dim name As String = My.Computer.FileSystem.GetName(
obj.ToString)
Dim bytes() As Byte
bytes = My.Computer.FileSystem.ReadAllBytes(obj.ToString)
Dim bn As Integer = bytes.Length
My.Computer.FileSystem.WriteAllBytes(
"C:\Mitio\Locked.Locked", bytes, True)
sw.WriteLine(bn.ToString + "*" + name)
ProgressBar1.Value += 1
Next
lb.Items.Clear()
sw.Close()
fs.Close()
ProgressBar1.Value = 0
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub