تقييم الموضوع :
  • 0 أصوات - بمعدل 0
  • 1
  • 2
  • 3
  • 4
  • 5
[VB.NET] مساعدة في تعديل كود
#1
السلام عليكم ورحمة الله وبركاته
دلوقتي انا بصمم برنامج بث مباشر
طبعا 
كود :
Function live(ByVal n As String) As String
       Dim host As String = "http://62.210.181.164:7777/"
       Dim usrps As String = "yacinenew1178/yacinenew1178/"
       Dim postData As String = ""
       Dim tempcookies As New CookieContainer
       Dim encoding As New UTF8Encoding
       Dim byteData As Byte() = encoding.GetBytes(postData)
       Dim postreq As HttpWebRequest = DirectCast(HttpWebRequest.Create(host & usrps & n), HttpWebRequest)
       'postreq.Proxy = Nothing
       postreq.Method = "GET"
       postreq.Timeout = 2500
       postreq.KeepAlive = True
       postreq.AllowAutoRedirect = False
       postreq.UserAgent = "yacineapp.tv"
       postreq.Host = "62.210.181.164:7777"
       postreq.Headers.Add("Accept-Encoding: none")
       Dim postresponse As HttpWebResponse
       Try
           postresponse = DirectCast(postreq.GetResponse, HttpWebResponse)
       Catch ex As Exception

           MessageBox.Show(ex.Message)

           Return Nothing

       End Try
       postresponse = DirectCast(postreq.GetResponse, HttpWebResponse)
       tempcookies.Add(postresponse.Cookies)
       Dim postreqreader As New StreamReader(postresponse.GetResponseStream())
       Dim chlink As String = postresponse.GetResponseHeader("Location")
       VLCP.playlist.stop()
       VLCP.playlist.items.clear()
       VLCP.playlist.add(chlink.Trim)
       VLCP.playlist.play()
       VLCP.CtlVisible = True
       Return Nothing
   End Function
طبعا لما بضغط علي البوتن علي 3 زراير مثلا او علي اي زرار تلت مرات السيرفر بيقطع وبيجيب رسالة ان السيرفر تم قطعه
فانا عاوز حد خبره يعدلي علي الكود بحيث ان السيرفر ميقطعش الاتصال 
اتمني ان حد يكون فهمني
الرد }}}
تم الشكر بواسطة:
#2
up up up up up
الرد }}}
تم الشكر بواسطة:
#3
up up up up up
الرد }}}
تم الشكر بواسطة: bidaya
#4
(15-09-20, 11:09 PM)ميدو الفنان كتب : up up up up up

فقط ظيف السطر

كود :
 postreqreader.Close()
تحت

كود :
 Dim postreqreader As New StreamReader(postresponse.GetResponseStream())
الرد }}}
#5
(16-09-20, 12:03 AM)bidaya كتب :
(15-09-20, 11:09 PM)ميدو الفنان كتب : up up up up up

فقط ظيف السطر

كود :
 postreqreader.Close()
تحت

كود :
 Dim postreqreader As New StreamReader(postresponse.GetResponseStream())
يا اخي مش عارف اشكرك ازاي والله 
كلمة شكر لا تكفي والله
اشكرك يا غالي جدا
الرد }}}
تم الشكر بواسطة:



التنقل السريع :


يقوم بقرائة الموضوع: بالاضافة الى ( 1 ) ضيف كريم