是否可以在PictureBox中加载PHP结果(回显)?

时间:2019-01-03 15:34:27

标签: vb.net

Private Sub Form1_Load(sender As Object, e As EventArgs) Handles    MyBase.Load
    RefreshImage1(Nothing, Nothing)
    timer = New System.Windows.Forms.Timer()
    AddHandler timer.Tick, AddressOf Me.RefreshImage1
    timer.Interval = 20000
    timer.Start()
End Sub

Protected Sub RefreshImage1(sender As Object, e As EventArgs)
    Dim HttpResource As String =  client.DownloadString("http://metalrockpopradio.caramania.com/3

 .php")
    Dim ParseStart As Integer = HttpResource.IndexOf("=") + 2
    HttpResource = HttpResource.Substring(ParseStart,   HttpResource.LastIndexOf(ChrW(34)) - ParseStart)
    If PictureBox5.Image IsNot Nothing Then PictureBox5.Image.Dispose()
    PictureBox5.Load(HttpResource)
    PictureBox5.SizeMode = PictureBoxSizeMode.StretchImage
End Sub

Private Sub Form1_FormClosed(sender As Object, e As  



FormClosedEventArgs)  Handles MyBase.FormClosed
    client.Dispose()
    timer.Dispose()
    End Sub
  

我为picturebox5更改了picturebox4,但对于form1,它说我有多个form1实例,而当我为form2更改时,picturebox中什么也没有。问题很奇怪,我不知道如何解决。   您能帮我吗,我需要它,之后我可以发布我的解决方案...   我尝试了所有事情,但没有任何效果。

0 个答案:

没有答案