Claro, mirad:
Un saludo.
Código (vbnet) [Seleccionar]
Imports SKYPE4COMLib
Imports System.IO
Public Class frmMain
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
'Dim pUser As SKYPE4COMLib.User
Dim total As Integer = ListBox1.Items.Count
Dim startingPosition As Integer = 0
If File.Exists(".\contactos-temp.txt") Then
Using sr As New StreamReader(".\contactos-temp.txt")
sr.Read()
startingPosition = Convert.ToInt32(sr.ReadToEnd)
sr.Close()
End Using
End If
Dim contactos As Integer
Dim CurrentPosition As Integer = 0
If contactos < 200 And startingPosition < ListBox1.Items.Count Then
For x As Integer = startingPosition To ListBox1.Items.Count - 1
Dim oUser As SKYPE4COMLib.User = CType(ListBox1.Items(x), SKYPE4COMLib.User)
Dim pUser As SKYPE4COMLib.User
pUser = oSkype.User(oUser)
pUser.BuddyStatus = SKYPE4COMLib.TBuddyStatus.budPendingAuthorization
oSkype.Friends.Add(pUser)
contactos += 1
pUser = Nothing
CurrentPosition = x
Next
Else
Using sw As New StreamWriter(".\contactos-temp.txt")
sw.Write(CurrentPosition)
sw.Close()
End Using
Process.Start(".\Agregueitor_6000.exe")
End If
cambio = contactos * 100 / total
ProgressBar1.Value = cambio
End Sub
Un saludo.