Hallo ich programmiere gerade ein iTunes fürs handy doch habe ein Problem nählich wenn das Handy syncroniesiert bleibt das Programm Hängen bis es fertig syncroniesiert hat![verwirrt](https://entwickler-forum.de/core/images/smilies/confused.png)
![Verärgert](https://entwickler-forum.de/core/images/smilies/mad.png)
. Ich hoffe jemand kann mir helfen und/oder den Code für mich umschreiben.
Code:
[highlight=vbnet]Private Sub musicsync()
If CheckBox1.Checked Then
Dim einreader As New StreamReader(Application.StartupPath & "/music.dll")
Try
Dim einmusic As String = (einreader.ReadLine)
Dim pathfree As String
While einreader.Peek > -1
einmusic = einreader.ReadLine
pathfree = My.Computer.FileSystem.GetName(einmusic)
File.Copy(einmusic, My.Settings.phonepfad & My.Settings.musicpfad & pathfree, True)
End While
Catch ex As Exception
End Try
einreader.Close()
End If
If CheckBox2.Checked Then
Dim einreader As New StreamReader(Application.StartupPath & "/videos.dll")
Try
Dim einmusic As String = (einreader.ReadLine)
Dim pathfree As String
While einreader.Peek > -1
einmusic = einreader.ReadLine
pathfree = My.Computer.FileSystem.GetName(einmusic)
File.Copy(einmusic, My.Settings.phonepfad & My.Settings.videopfad & pathfree, True)
End While
Catch ex As Exception
End Try
einreader.Close()
End If
If CheckBox3.Checked Then
Dim einreader As New StreamReader(Application.StartupPath & "/apps.dll")
Try
Dim einmusic As String = (einreader.ReadLine)
Dim pathfree As String
While einreader.Peek > -1
einmusic = einreader.ReadLine
pathfree = My.Computer.FileSystem.GetName(einmusic)
File.Copy(einmusic, My.Settings.phonepfad & My.Settings.appspfad & pathfree, True)
End While
Catch ex As Exception
End Try
einreader.Close()
End If
PictureBox8.Hide()
PictureBox6.Show()
End Sub[/highlight]
![verwirrt](https://entwickler-forum.de/core/images/smilies/confused.png)
![Verärgert](https://entwickler-forum.de/core/images/smilies/mad.png)
![verwirrt](https://entwickler-forum.de/core/images/smilies/confused.png)
Code:
[highlight=vbnet]Private Sub musicsync()
If CheckBox1.Checked Then
Dim einreader As New StreamReader(Application.StartupPath & "/music.dll")
Try
Dim einmusic As String = (einreader.ReadLine)
Dim pathfree As String
While einreader.Peek > -1
einmusic = einreader.ReadLine
pathfree = My.Computer.FileSystem.GetName(einmusic)
File.Copy(einmusic, My.Settings.phonepfad & My.Settings.musicpfad & pathfree, True)
End While
Catch ex As Exception
End Try
einreader.Close()
End If
If CheckBox2.Checked Then
Dim einreader As New StreamReader(Application.StartupPath & "/videos.dll")
Try
Dim einmusic As String = (einreader.ReadLine)
Dim pathfree As String
While einreader.Peek > -1
einmusic = einreader.ReadLine
pathfree = My.Computer.FileSystem.GetName(einmusic)
File.Copy(einmusic, My.Settings.phonepfad & My.Settings.videopfad & pathfree, True)
End While
Catch ex As Exception
End Try
einreader.Close()
End If
If CheckBox3.Checked Then
Dim einreader As New StreamReader(Application.StartupPath & "/apps.dll")
Try
Dim einmusic As String = (einreader.ReadLine)
Dim pathfree As String
While einreader.Peek > -1
einmusic = einreader.ReadLine
pathfree = My.Computer.FileSystem.GetName(einmusic)
File.Copy(einmusic, My.Settings.phonepfad & My.Settings.appspfad & pathfree, True)
End While
Catch ex As Exception
End Try
einreader.Close()
End If
PictureBox8.Hide()
PictureBox6.Show()
End Sub[/highlight]
Comment