Una cosa così ?
codice:Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load If Not IsPostBack Then Dim numero1 As Integer Dim rnd1 As New Random numero1 = rnd1.Next(0, 100) Session("numero1") = numero1 Dim numero2 As Integer Dim rnd2 As New Random numero2 = rnd2.Next(0, 30) Session("numero2") = numero2 lb1.Text = Session("numero1").ToString lb2.Text = Session("numero2").ToString End If End Sub Protected Sub bottone_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles bottone.Click If CInt(tb.Text) = CInt(Session("numero1")) + CInt(Session("numero2")) Then Response.Write("Corretto") End If End Sub

Rispondi quotando