11-02-17, 12:56 AM
(10-02-17, 10:19 PM)youssef1 كتب :العفووووو اخي بارك الله فيك(10-02-17, 09:35 PM)hassan كتب : بعد اذن الاخوانمتشكرا جدا ليك استاذ
تم التعديل على الكود
PHP كود :
Private channelList As New List(Of String)
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
If IO.File.Exists("C:\channellist.txt") Then
IO.File.Delete("C:\channellist.txt")
End If
My.Computer.Network.DownloadFile("http://mywebsite.com/channellist.txt", "C:\channellist.txt")
Dim lines() As String = File.ReadAllLines("C:\channellist.txt")
For Each l As String In lines
Dim data() As String = l.Split(",")
If data.Length = 2 Then
Me.ListBox1.Items.Add(data(0))
channelList.Add(data(1))
End If
Next
End Sub
Private Sub ListBox1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ListBox1.SelectedIndexChanged
If Me.ListBox1.SelectedIndex >= 0 Then
Me.WebBrowser1.Navigate(channelList(Me.ListBox1.SelectedIndex))
End If
End Sub
فقط قم بتعديل رابط ملف txt
شرح الاكواد المضافه
في هاذا الكود
PHP كود :
If IO.File.Exists("C:\channellist.txt") Then
IO.File.Delete("C:\channellist.txt")
End If
اعطينا امر التحقق من ملف channellist.txt اذ كان موجود قم بحذفه( لكي لا تحدث مشاكل مع الكود الاتي كود تحميل الملف )
في الكود الثاني
PHP كود :
My.Computer.Network.DownloadFile("http://mywebsite.com/channellist.txt", "C:\channellist.txt")
قمنا بتحميل الملف ووضعه على مسار C:\channellist.txt
وباقي الاكواد المطرحه مسبقا معروف عمله
شكرا لكم
الحمد لله رب العالمين على كل شي