adsense

2010-10-19

依年齡顯示分級

Public Class Form1




Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

Dim s As String

s = TextBox1.Text

If (CInt(s) > 18) Then

MsgBox(s + ":可看 限制級")

End If

If (CInt(s) > 11 And CInt(s) < 18) Then

MsgBox(s + ":可看 輔導級")

End If

If (CInt(s) < 12) Then

MsgBox(s + ":可看 普級")

End If

End Sub



Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click

Dim s As String

s = TextBox1.Text

If (CInt(s) > 18) Then

MsgBox(s + ":可看 限制級")

End If

If (CInt(s) > 11) Then

If (CInt(s) < 18) Then

MsgBox(s + ":可看 輔導級")

End If

End If

If (CInt(s) < 12) Then

MsgBox(s + ":可看 普級")

End If

End Sub



Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click

Dim s = TextBox1.Text

If (CInt(s) > 18) Then

MsgBox(s + ":可看 限制級")

ElseIf (CInt(s) > 11 And CInt(s) < 18) Then

MsgBox(s + ":可看 輔導級")

ElseIf (CInt(s) < 12) Then

MsgBox(s + ":可看 普級")

End If



End Sub



Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click

Dim s As String

s = TextBox1.Text

If (CInt(s) > 18) Then

MsgBox(s + ":可看 限制級")

Else

If (CInt(s) > 11) Then

If (CInt(s) < 18) Then

MsgBox(s + ":可看 輔導級")

End If

End If

If (CInt(s) < 12) Then

MsgBox(s + ":可看 普級")

End If

End If



End Sub

End Class

沒有留言:

張貼留言