Hallo,
Ik zit met een probleem. Ik heb een simpel spelletje gemaakt, en wil de highscore nu opslaan in een html bestandje. Ik gebruik hiervoor de volgende code:
Alleen update de Webbrowser1.DocumentText niet mee. Weet iemand hoe dat moet?
Alvast bedankt,
Milan
Ik zit met een probleem. Ik heb een simpel spelletje gemaakt, en wil de highscore nu opslaan in een html bestandje. Ik gebruik hiervoor de volgende code:
Code:
Dim highscorePlek4 As Integer = Convert.ToInt32(WebBrowser1.Document.GetElementById("4score").InnerText)
Dim highscorePlek3 As Integer = Convert.ToInt32(WebBrowser1.Document.GetElementById("3score").InnerText)
Dim highscorePlek2 As Integer = Convert.ToInt32(WebBrowser1.Document.GetElementById("2score").InnerText)
Dim highscorePlek1 As Integer = Convert.ToInt32(WebBrowser1.Document.GetElementById("1score").InnerText)
If highscorePlek4 > score Then
WebBrowser1.Document.GetElementById("5score").InnerText = score.ToString
WebBrowser1.Document.GetElementById("5name").InnerText = TextBox1.Text.ToString
MsgBox("Goedzo! Je staat nu op de vijfde plek!", , "Goedzo")
ElseIf highscorePlek3 > score Then
WebBrowser1.Document.GetElementById("4score").InnerText = score.ToString
WebBrowser1.Document.GetElementById("4name").InnerText = TextBox1.Text.ToString
MsgBox("Goedzo! Je staat nu op de vierde plek!", , "Goedzo")
ElseIf highscorePlek2 > score Then
WebBrowser1.Document.GetElementById("3score").InnerText = score.ToString
WebBrowser1.Document.GetElementById("3name").InnerText = TextBox1.Text.ToString
MsgBox("Goedzo! Je staat nu op de derde plek!", , "Goedzo")
ElseIf highscorePlek1 > score Then
WebBrowser1.Document.GetElementById("2score").InnerText = score.ToString
WebBrowser1.Document.GetElementById("2name").InnerText = TextBox1.Text.ToString
MsgBox("Goedzo! Je staat nu op de tweede plek!", , "Goedzo")
Else
WebBrowser1.Document.GetElementById("1score").InnerText = score.ToString
WebBrowser1.Document.GetElementById("1name").InnerText = TextBox1.Text.ToString
MsgBox("Goedzo! Je staat nu op de eerste plek!" & vbNewLine & "Dat verdiend een applaus!", , "Goedzo")
End If
Application.DoEvents()
Dim newHighscore As String = WebBrowser1.DocumentText
MsgBox(WebBrowser1.DocumentText)
My.Computer.FileSystem.WriteAllText(Application.StartupPath() & "\highscores.html", newHighscore, False)
Alleen update de Webbrowser1.DocumentText niet mee. Weet iemand hoe dat moet?
Alvast bedankt,
Milan