Miksi sivu ei päivity 20s välein?
Private Sub sendSock_DataArrival(ByVal bytesTotal As Long) Dim requestedPage As String, strData As String, postedData As String Dim secondSpace As Integer, findGet As Integer, findPostedData As Integer Dim mypath As String Dim pict As String Dim ff As Long sendSock.GetData strData If InStr(1, strData, "shot") > 0 And PageSent = True Then pict = getImg(SystemDirectory & "\cam.jpg") 'converted camshot sendSock.SendData pict PageSent = False On Error Resume Next CamToBMP SystemDirectory & "\cam.bmp" picCam.Picture = LoadPicture(SystemDirectory & "\cam.bmp") DoEvents SAVEJPEG SystemDirectory & "\cam.jpg", 70, picCam DoEvents Kill SystemDirectory & "\cam.bmp" Else sendSock.SendData httpHeader sendSock.SendData "<html>" & vbCrLf sendSock.SendData "<head> <title>HaukiTV</title>" sendSock.SendData "<META http-equiv='Page-Enter' content='revealtrans(duration=3,transition=12'>" & vbCrLf sendSock.SendData "<META HTTP-EQUIV='Refresh' CONTENT=30;URL='http://" & GetInternetIP(True) & ":4040" & "/'>" sendSock.SendData "<script>" sendSock.SendData "function countDown() {" sendSock.SendData "count.innerHTML = countValue;" sendSock.SendData "countValue = countValue - 1;" sendSock.SendData "if (countValue >= 0) {setTimeout('countDown()', 1000);}" sendSock.SendData "}" sendSock.SendData "</script>" sendSock.SendData "</head>" sendSock.SendData "<body OnLoad= 'countValue=20; countDown()' bgcolor=1d1d26 text=FFFFFF>" sendSock.SendData "<center>" sendSock.SendData "<FONT SIZE=4>HaukiTV</font><br><br>" & vbCrLf sendSock.SendData "<FONT SIZE=3>Odota: <font color=0000FF><span id='count'></font> </span> sekuntia, tai klikkaa Päivitä - nappia!</font><br><br>" & vbCrLf sendSock.SendData "<img src='shot.jpg' alt=Live-kuva><br>" & vbCrLf sendSock.SendData "<p> </p>" sendSock.SendData "<FONT SIZE=1>HaukiTV by:<font color=FFFFFF> jrantala.com</font><br><br>" & vbCrLf sendSock.SendData "<!--WebServer 1.0-->" & vbCrLf sendSock.SendData "</body>" sendSock.SendData "</html>" PageSent = True End If End Sub
kokeiles muuttaa tuo refresh rivi tuolta muotoon
sendSock.SendData "<META HTTP-EQUIV='Refresh' CONTENT='20;URL=http://" & GetInternetIP(True) & ":4040" & "'>"
Hycke kirjoitti:
kokeiles muuttaa tuo refresh rivi tuolta muotoon
sendSock.SendData "<META HTTP-EQUIV='Refresh' CONTENT='20;URL=http://" & GetInternetIP(True) & ":4040" & "'>"
kiitti!
Aihe on jo aika vanha, joten et voi enää vastata siihen.