Advertisement
Guest User

Certification Study Helper v1.0 source code

a guest
Mar 19th, 2016
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 47.37 KB | None | 0 0
  1. Public Class frmStudy
  2.   'Name :Zach Griffin
  3.   'Forum Handle :Tasmainia300
  4.   'Date started :3/7/2016
  5.   'Purpose :Submission for the TekSyndicate community Just Do It Challenge
  6.   'Functionality :This program is designed to help you study for a CompTIA Certification. First iterations will likely include limited functionality such as -
  7.   'a flash-card-style port number quiz. Possible future iterations may enable you to customize functionality and input the information you want to study.
  8.   'Source :Thanks to blogs.getcertifiedgetahead.com for acting as my source of port number information
  9.   'Version :1.0
  10.   'Build :1
  11.   'Build Details :Includes port number information rated for CompTIA A+, Network+ and Security+ exams, as well as practice quiz to test your knowledge.
  12.   'Credit for Icon :Henrik Lund Mikkelsen on The Noun Project. Licensed under Creative Commons.
  13.   Public score As Integer = 0
  14.   Public failNum As Integer = 0
  15.   Public subjectComplete As Integer = 0
  16.   Public subjectTracker As Double = 0
  17.   Public scoreTotal As String
  18.   'setting up a score system
  19.  
  20.  
  21.   Private Sub lstSubject_SelectedIndexChanged(sender As Object, e As EventArgs) Handles lstSubject.SelectedIndexChanged
  22.     Me.AcceptButton = btnSubject
  23.     '^^ Allowing the user to hit enter instead of clicking the button
  24.     Select Case lstSubject.Text 'handles what to do in case of a selection within the list box
  25.       Case "Port Numbers"
  26.         rtbQuestion.Clear()
  27.         subjectTracker = 1 'tracks which subject is currently selected to handle conditional statements later in code
  28.         lstSubject.Items.Clear()
  29.         lstSubject.Items.AddRange(IO.File.ReadAllLines("F:\My Stuff\Visual Basic Projects\Port Number Quiz TS Challenge v0.1\prtNumbers.txt"))
  30.         '^^ Maintains fidelity of the list boxes contents
  31.       Case "Port 20" 'handles the information for the "Port Study" subject
  32.         rtbQuestion.Text = "Port 20 is commonly used by FTP(File Transfer Protocol) to transfer data."
  33.       Case "Port 21"
  34.         rtbQuestion.Text = "Port 21 is commonly used by FTP(File Transfer Protocol) to listen for commands."
  35.       Case "Port 22"
  36.         rtbQuestion.Text = "Port 22 is commonly used by SSH(Secure Shell), and other protocols that use SSH, such as SCP(Secure Copy) and SFTP(Secure File Transfer Protocol)."
  37.       Case "Port 23"
  38.         rtbQuestion.Text = "Port 23 is used by TELNET."
  39.       Case "Port 25"
  40.         rtbQuestion.Text = "Port 25 is commonly used by SMTP(Simple Mail Transport Protocol) for outgoing mail."
  41.       Case "Port 49"
  42.         rtbQuestion.Text = "Port 49 is commonly used by TACACS(Termincal Access Controller Access-Control System) for authentication."
  43.       Case "Port 53"
  44.         rtbQuestion.Text = "Port 53 is commonly used by DNS(Domain Name Service)."
  45.       Case "Port 67"
  46.         rtbQuestion.Text = "Port 67 is used by DHCP(Dynamic Host Configuration Protocol) servers."
  47.       Case "Port 68"
  48.         rtbQuestion.Text = "Port 68 is used by DHCP(Dynamic Host Configuration Protocol) clients."
  49.       Case "Port 69"
  50.         rtbQuestion.Text = "Port 69 is used by TFTP(Trivial File Transport Protocol)."
  51.       Case "Port 80"
  52.         rtbQuestion.Text = "Port 80 is used by HTTP(Hypertext Transfer Protocol) for web traffic."
  53.       Case "Port 88"
  54.         rtbQuestion.Text = "Port 88 is commonly used by Kerberos for authentication."
  55.       Case "Port 110"
  56.         rtbQuestion.Text = "Port 110 is commonly used by POP3(Post-Office-Protocol) for incoming mail."
  57.       Case "Port 119"
  58.         rtbQuestion.Text = "Port 119 is used by NNTP(Network News Transfer Protocol) for news traffic."
  59.       Case "Port 123"
  60.         rtbQuestion.Text = "Port 123 is used by NTP(Network Time Protocol) to synchronize clocks."
  61.       Case "Port 143"
  62.         rtbQuestion.Text = "Port 143 is used by IMAP4(Internet Message Access Protocol v4)."
  63.       Case "Port 161"
  64.         rtbQuestion.Text = "Port 161 is used by SNMP(Simple Network Management Protocol) for network monitoring."
  65.       Case "Port 162"
  66.         rtbQuestion.Text = "Port 162 is used by SNMP Trap(Simple Network Management Protocol Trap) for alerts."
  67.       Case "Port 389"
  68.         rtbQuestion.Text = "Port 389 is commonly used by LDAP(Lightweight Directory Access Protocol)."
  69.       Case "Port 443"
  70.         rtbQuestion.Text = "Port 443 is commonly used by HTTPS(Hypertext Transfer Protocol Secure) for web traffic and by SSL VPN(Secure Sockets Layer VPN)."
  71.       Case "Port 500"
  72.         rtbQuestion.Text = "Port 500 is commonly used by IPsec(Internet Protocol Security) over ISAKMP(Internet Security Association and Key Management Protocol[VPN])."
  73.       Case "Port 514"
  74.         rtbQuestion.Text = "Port 514 is commonly used by Syslog."
  75.       Case "Port 1701"
  76.         rtbQuestion.Text = "Port 1701 is commonly used by L2TP(Layer 2 Tunneling Protocol)."
  77.       Case "Port 1723"
  78.         rtbQuestion.Text = "Port 1723 is commonly used by PPTP(Point-to-Point Tunneling Protocol)."
  79.       Case "Port 3389"
  80.         rtbQuestion.Text = "Port 3389 is used by RDP(Remote Desktop Protocol) for connections."
  81.     End Select
  82.  
  83.  
  84.  
  85.  
  86.   End Sub
  87.  
  88.   Private Sub btnSubject_Click(sender As Object, e As EventArgs) Handles btnSubject.Click
  89.     'setting score to 0 at start of new subject selection
  90.     score = 0
  91.     If lstSubject.Text = "   -Port Numbers Quiz" Then
  92.       'setting up the port number quiz
  93.       lstSubject.Items.Clear()
  94.       lstSubject.Items.AddRange(IO.File.ReadAllLines("F:\My Stuff\Visual Basic Projects\Port Number Quiz TS Challenge v0.1\prtNumbers.txt"))
  95.       '^^Maintains the listbox's contents
  96.       subjectTracker = 1.2
  97.       'tracks which subject is active for conditional statements
  98.       scoreTotal = "/27"
  99.       'sets score total as a variable for scalability. i.e I can more easily add extra questions to the port number quiz as i only need to change the value once
  100.       txtScore.Text = score & scoreTotal
  101.       '^^ sets the score visible to the user
  102.       lblAnswer.Visible = True
  103.       txtAnswer.Visible = True
  104.       txtAnswer.Focus()
  105.       btnNext.Visible = True
  106.       btnPrev.Visible = True
  107.       rtbQuestion.Visible = True
  108.       btnAnswer.Visible = True
  109.       lblScore.Visible = True
  110.       txtScore.Visible = True
  111.       '^"fetches" all the controls needed for the quiz
  112.       Me.AcceptButton = btnAnswer
  113.       '^^Allowing the user to hit enter instead of clicking the button
  114.  
  115.       rtbQuestion.Text = "What port does HTTP operate over?"
  116.     ElseIf lstSubject.Text = "   -Port Numbers Study" Then
  117.       lstSubject.Items.AddRange(IO.File.ReadAllLines("F:\My Stuff\Visual Basic Projects\Port Number Quiz TS Challenge v0.1\Port Numbers.txt"))
  118.       subjectTracker = 1.1
  119.       '^^^Tracks active subject for future conditional statements
  120.       'Variables are strictly for my reference in code and should remain commented out in published builds to save memory space.
  121.       'Dim http As Integer = 80
  122.       'Dim ftp As Integer = 21
  123.       'Dim telnet As Integer = 23
  124.       'Dim smtp As Integer = 25
  125.       'Dim popthree As Integer = 110
  126.       'Dim https As Integer = 443
  127.       'Dim ssh As Integer = 22
  128.       'Dim dns As Integer = 53
  129.       'Dim dhcpClient As Integer = 68
  130.       'Dim dhcpServer As Integer = 67
  131.       'Dim tftp As Integer = 69
  132.       'Dim ntp As Integer = 123
  133.       'Dim imap4 As Integer = 143
  134.       'Dim snmp As Integer = 161
  135.       'Dim ipsec As Integer = 500
  136.       'Dim rdp As Integer = 3389
  137.       'Dim sftp As Integer = 22
  138.       'Dim scp As Integer = 22
  139.       'Dim sslVpn As Integer = 443
  140.       'Dim tacacs As Integer = 49
  141.       'Dim kerberos As Integer = 88
  142.       'Dim nntp As Integer = 119
  143.       'Dim snmpTrap As Integer = 162
  144.       'Dim ldap As Integer = 389
  145.       'Dim syslog As Integer = 514
  146.       'Dim l2tp As Integer = 1701
  147.       'Dim pptp As Integer = 1723
  148.       rtbQuestion.Visible = True 'fetches controls needed for port number studying.
  149.       rtbQuestion.Clear()
  150.       txtScore.Visible = False
  151.       lblScore.Visible = False
  152.       btnAnswer.Visible = False
  153.       lblAnswer.Visible = False
  154.       btnNext.Visible = False
  155.       btnPrev.Visible = False
  156.       txtAnswer.Visible = False
  157.     End If
  158.   End Sub
  159.  
  160.   Private Sub btnAnswer_Click(sender As Object, e As EventArgs) Handles btnAnswer.Click
  161.     'This is gonna be long... until I figure out how to condense it... which is probably incredibly easy...
  162.     If subjectTracker = 1.2 Then 'uses subjectTracker to determine which quiz is being taken
  163.       If rtbQuestion.Text = "What port does FTP operate on?" Then 'if port number quiz, initialize answer checking based on contents of rtbQuestion -
  164.         If txtAnswer.Text = "21" Then                             'because I couldn't figure out how else to do it...
  165.           rtbQuestion.Text = "Correct! File Transfer Protocol operates on port 21"
  166.           score += 1
  167.           txtScore.Text = score & scoreTotal
  168.           'determines and updates score
  169.         ElseIf txtAnswer.Text = "" Then 'Fixes undesirable functionality where accidentaly hitting enter or submit answer before typing one will raise the fail counter.
  170.           My.Computer.Audio.PlaySystemSound(Media.SystemSounds.Hand) 'plays a sound to alert the user of an error
  171.           MessageBox.Show("You didn't enter anything!", "Error")
  172.           txtAnswer.Focus()
  173.         Else
  174.           My.Computer.Audio.PlaySystemSound(Media.SystemSounds.Hand)
  175.           MessageBox.Show("Wrong, please try again. (Provide ports as integers please)", "Oops!")
  176.           txtAnswer.Clear()
  177.           txtAnswer.Focus()
  178.           failNum += 1 'Counter to fail those who miss 10.
  179.           'handles wrong answers^^^^
  180.         End If
  181.       End If
  182.  
  183.       If rtbQuestion.Text = "What port does HTTP operate over?" Then
  184.         If txtAnswer.Text = "80" Then
  185.           rtbQuestion.Text = "Correct! HyperText Transfer Protocol operates on port 80"
  186.           score += 1
  187.           txtScore.Text = score & scoreTotal
  188.         ElseIf txtAnswer.Text = "" Then 'Fixes undesirable functionality where accidentaly hitting enter or submit answer before typing one will raise the fail counter.
  189.           My.Computer.Audio.PlaySystemSound(Media.SystemSounds.Hand)
  190.           MessageBox.Show("You didn't enter anything!", "Error")
  191.           txtAnswer.Focus()
  192.         Else
  193.           My.Computer.Audio.PlaySystemSound(Media.SystemSounds.Hand)
  194.           MessageBox.Show("Wrong, please try again. (Provide ports as integers please)", "Oops!")
  195.           txtAnswer.Clear()
  196.           txtAnswer.Focus()
  197.           failNum += 1
  198.         End If
  199.       End If
  200.  
  201.       If rtbQuestion.Text = "What port does TELNET operate over?" Then
  202.         If txtAnswer.Text = "23" Then
  203.           rtbQuestion.Text = "Correct! TELNET operates on port 23"
  204.           score += 1
  205.           txtScore.Text = score & scoreTotal
  206.         ElseIf txtAnswer.Text = "" Then 'Fixes undesirable functionality where accidentaly hitting enter or submit answer before typing one will raise the fail counter.
  207.           My.Computer.Audio.PlaySystemSound(Media.SystemSounds.Hand)
  208.           MessageBox.Show("You didn't enter anything!", "Error")
  209.           txtAnswer.Focus()
  210.         Else
  211.           My.Computer.Audio.PlaySystemSound(Media.SystemSounds.Hand)
  212.           MessageBox.Show("Wrong, please try again. (Provide ports as integers please)", "Oops!")
  213.           txtAnswer.Clear()
  214.           txtAnswer.Focus()
  215.           failNum += 1
  216.         End If
  217.       End If
  218.       If rtbQuestion.Text = "What port does SMTP operate on?" Then
  219.         If txtAnswer.Text = "25" Then
  220.           rtbQuestion.Text = "Correct! Simple Mail Transfer Protocol operates on port 25"
  221.           score += 1
  222.           txtScore.Text = score & scoreTotal
  223.         ElseIf txtAnswer.Text = "" Then 'Fixes undesirable functionality where accidentaly hitting enter or submit answer before typing one will raise the fail counter.
  224.           My.Computer.Audio.PlaySystemSound(Media.SystemSounds.Hand)
  225.           MessageBox.Show("You didn't enter anything!", "Error")
  226.           txtAnswer.Focus()
  227.         Else
  228.           My.Computer.Audio.PlaySystemSound(Media.SystemSounds.Hand)
  229.           MessageBox.Show("Wrong, please try again. (Provide ports as integers please)", "Oops!")
  230.           txtAnswer.Clear()
  231.           txtAnswer.Focus()
  232.           failNum += 1
  233.         End If
  234.       End If
  235.       If rtbQuestion.Text = "What port does POP3 operate on?" Then
  236.         If txtAnswer.Text = "110" Then
  237.           rtbQuestion.Text = "Correct! POP3 operates on port 110"
  238.           score += 1
  239.           txtScore.Text = score & scoreTotal
  240.         ElseIf txtAnswer.Text = "" Then 'Fixes undesirable functionality where accidentaly hitting enter or submit answer before typing one will raise the fail counter.
  241.           My.Computer.Audio.PlaySystemSound(Media.SystemSounds.Hand)
  242.           MessageBox.Show("You didn't enter anything!", "Error")
  243.           txtAnswer.Focus()
  244.         Else
  245.           My.Computer.Audio.PlaySystemSound(Media.SystemSounds.Hand)
  246.           MessageBox.Show("Wrong, please try again. (Provide ports as integers please)", "Oops!")
  247.           txtAnswer.Clear()
  248.           txtAnswer.Focus()
  249.           failNum += 1
  250.         End If
  251.       End If
  252.       If rtbQuestion.Text = "What port does HTTPS operate over?" Then
  253.         If txtAnswer.Text = "443" Then
  254.           rtbQuestion.Text = "Correct! HyperText Transfer Protocol Secure operates on port 443"
  255.           score += 1
  256.           txtScore.Text = score & scoreTotal
  257.         ElseIf txtAnswer.Text = "" Then 'Fixes undesirable functionality where accidentaly hitting enter or submit answer before typing one will raise the fail counter.
  258.           My.Computer.Audio.PlaySystemSound(Media.SystemSounds.Hand)
  259.           MessageBox.Show("You didn't enter anything!", "Error")
  260.           txtAnswer.Focus()
  261.         Else
  262.           My.Computer.Audio.PlaySystemSound(Media.SystemSounds.Hand)
  263.           MessageBox.Show("Wrong, please try again. (Provide ports as integers please)", "Oops!")
  264.           txtAnswer.Clear()
  265.           txtAnswer.Focus()
  266.           failNum += 1
  267.         End If
  268.       End If
  269.       If rtbQuestion.Text = "What port does SSH use?" Then
  270.         If txtAnswer.Text = "22" Then
  271.           rtbQuestion.Text = "Correct! Secure Shell uses port 22"
  272.           score += 1
  273.           txtScore.Text = score & scoreTotal
  274.         ElseIf txtAnswer.Text = "" Then 'Fixes undesirable functionality where accidentaly hitting enter or submit answer before typing one will raise the fail counter.
  275.           My.Computer.Audio.PlaySystemSound(Media.SystemSounds.Hand)
  276.           MessageBox.Show("You didn't enter anything!", "Error")
  277.           txtAnswer.Focus()
  278.         Else
  279.           My.Computer.Audio.PlaySystemSound(Media.SystemSounds.Hand)
  280.           MessageBox.Show("Wrong, please try again. (Provide ports as integers please)", "Oops!")
  281.           txtAnswer.Clear()
  282.           txtAnswer.Focus()
  283.           failNum += 1
  284.         End If
  285.       End If
  286.       If rtbQuestion.Text = "What port does TACACS use?" Then
  287.         If txtAnswer.Text = "49" Then
  288.           rtbQuestion.Text = "Correct! Terminal Access Controller Access-Control System uses port 49"
  289.           score += 1
  290.           txtScore.Text = score & scoreTotal
  291.         ElseIf txtAnswer.Text = "" Then 'Fixes undesirable functionality where accidentaly hitting enter or submit answer before typing one will raise the fail counter.
  292.           My.Computer.Audio.PlaySystemSound(Media.SystemSounds.Hand)
  293.           MessageBox.Show("You didn't enter anything!", "Error")
  294.           txtAnswer.Focus()
  295.         Else
  296.           My.Computer.Audio.PlaySystemSound(Media.SystemSounds.Hand)
  297.           MessageBox.Show("Wrong, please try again. (Provide ports as integers please)", "Oops!")
  298.           txtAnswer.Clear()
  299.           txtAnswer.Focus()
  300.           failNum += 1
  301.         End If
  302.       End If
  303.       If rtbQuestion.Text = "What port does Kerberos use?" Then
  304.         If txtAnswer.Text = "88" Then
  305.           rtbQuestion.Text = "Correct! Kerberos uses port 88"
  306.           score += 1
  307.           txtScore.Text = score & scoreTotal
  308.         ElseIf txtAnswer.Text = "" Then 'Fixes undesirable functionality where accidentaly hitting enter or submit answer before typing one will raise the fail counter.
  309.           My.Computer.Audio.PlaySystemSound(Media.SystemSounds.Hand)
  310.           MessageBox.Show("You didn't enter anything!", "Error")
  311.           txtAnswer.Focus()
  312.         Else
  313.           My.Computer.Audio.PlaySystemSound(Media.SystemSounds.Hand)
  314.           MessageBox.Show("Wrong, please try again. (Provide ports as integers please)", "Oops!")
  315.           txtAnswer.Clear()
  316.           txtAnswer.Focus()
  317.           failNum += 1
  318.         End If
  319.       End If
  320.       If rtbQuestion.Text = "What port does NTP operate on?" Then
  321.         If txtAnswer.Text = "123" Then
  322.           rtbQuestion.Text = "Correct! Network Time Protocol uses port 123"
  323.           score += 1
  324.           txtScore.Text = score & scoreTotal
  325.         ElseIf txtAnswer.Text = "" Then 'Fixes undesirable functionality where accidentaly hitting enter or submit answer before typing one will raise the fail counter.
  326.           My.Computer.Audio.PlaySystemSound(Media.SystemSounds.Hand)
  327.           MessageBox.Show("You didn't enter anything!", "Error")
  328.           txtAnswer.Focus()
  329.         Else
  330.           My.Computer.Audio.PlaySystemSound(Media.SystemSounds.Hand)
  331.           MessageBox.Show("Wrong, please try again. (Provide ports as integers please)", "Oops!")
  332.           txtAnswer.Clear()
  333.           txtAnswer.Focus()
  334.           failNum += 1
  335.         End If
  336.       End If
  337.       If rtbQuestion.Text = "What port does NNTP operate over?" Then
  338.         If txtAnswer.Text = "119" Then
  339.           rtbQuestion.Text = "Correct! Network News Transfer Protocol uses port 119"
  340.           score += 1
  341.           txtScore.Text = score & scoreTotal
  342.         ElseIf txtAnswer.Text = "" Then 'Fixes undesirable functionality where accidentaly hitting enter or submit answer before typing one will raise the fail counter.
  343.           My.Computer.Audio.PlaySystemSound(Media.SystemSounds.Hand)
  344.           MessageBox.Show("You didn't enter anything!", "Error")
  345.           txtAnswer.Focus()
  346.         Else
  347.           My.Computer.Audio.PlaySystemSound(Media.SystemSounds.Hand)
  348.           MessageBox.Show("Wrong, please try again. (Provide ports as integers please)", "Oops!")
  349.           txtAnswer.Clear()
  350.           txtAnswer.Focus()
  351.           failNum += 1
  352.         End If
  353.       End If
  354.       If rtbQuestion.Text = "What port does TFTP operate on?" Then
  355.         If txtAnswer.Text = "69" Then
  356.           rtbQuestion.Text = "Correct! Trivial File Transport Protocol uses port 69"
  357.           score += 1
  358.           txtScore.Text = score & scoreTotal
  359.         ElseIf txtAnswer.Text = "" Then 'Fixes undesirable functionality where accidentaly hitting enter or submit answer before typing one will raise the fail counter.
  360.           My.Computer.Audio.PlaySystemSound(Media.SystemSounds.Hand)
  361.           MessageBox.Show("You didn't enter anything!", "Error")
  362.           txtAnswer.Focus()
  363.         Else
  364.           My.Computer.Audio.PlaySystemSound(Media.SystemSounds.Hand)
  365.           MessageBox.Show("Wrong, please try again. (Provide ports as integers please)", "Oops!")
  366.           txtAnswer.Clear()
  367.           txtAnswer.Focus()
  368.           failNum += 1
  369.         End If
  370.       End If
  371.       If rtbQuestion.Text = "What port does SSL VPN operate over?" Then
  372.         If txtAnswer.Text = "443" Then
  373.           rtbQuestion.Text = "Correct! SSL VPN uses port 443"
  374.           score += 1
  375.           txtScore.Text = score & scoreTotal
  376.         ElseIf txtAnswer.Text = "" Then 'Fixes undesirable functionality where accidentaly hitting enter or submit answer before typing one will raise the fail counter.
  377.           My.Computer.Audio.PlaySystemSound(Media.SystemSounds.Hand)
  378.           MessageBox.Show("You didn't enter anything!", "Error")
  379.           txtAnswer.Focus()
  380.         Else
  381.           My.Computer.Audio.PlaySystemSound(Media.SystemSounds.Hand)
  382.           MessageBox.Show("Wrong, please try again. (Provide ports as integers please)", "Oops!")
  383.           txtAnswer.Clear()
  384.           txtAnswer.Focus()
  385.           failNum += 1
  386.         End If
  387.       End If
  388.       If rtbQuestion.Text = "What port does PPTP use?" Then
  389.         If txtAnswer.Text = "1723" Then
  390.           rtbQuestion.Text = "Correct! Point-to-Point Tunneling Protocol uses port 1723"
  391.           score += 1
  392.           txtScore.Text = score & scoreTotal
  393.         ElseIf txtAnswer.Text = "" Then 'Fixes undesirable functionality where accidentaly hitting enter or submit answer before typing one will raise the fail counter.
  394.           My.Computer.Audio.PlaySystemSound(Media.SystemSounds.Hand)
  395.           MessageBox.Show("You didn't enter anything!", "Error")
  396.           txtAnswer.Focus()
  397.         Else
  398.           My.Computer.Audio.PlaySystemSound(Media.SystemSounds.Hand)
  399.           MessageBox.Show("Wrong, please try again. (Provide ports as integers please)", "Oops!")
  400.           txtAnswer.Clear()
  401.           txtAnswer.Focus()
  402.           failNum += 1
  403.         End If
  404.       End If
  405.       If rtbQuestion.Text = "What port does L2TP operate on?" Then
  406.         If txtAnswer.Text = "1701" Then
  407.           rtbQuestion.Text = "Correct! Layer 2 Tunneling Protocol uses port 1701"
  408.           score += 1
  409.           txtScore.Text = score & scoreTotal
  410.         ElseIf txtAnswer.Text = "" Then 'Fixes undesirable functionality where accidentaly hitting enter or submit answer before typing one will raise the fail counter.
  411.           My.Computer.Audio.PlaySystemSound(Media.SystemSounds.Hand)
  412.           MessageBox.Show("You didn't enter anything!", "Error")
  413.           txtAnswer.Focus()
  414.         Else
  415.           My.Computer.Audio.PlaySystemSound(Media.SystemSounds.Hand)
  416.           MessageBox.Show("Wrong, please try again. (Provide ports as integers please)", "Oops!")
  417.           txtAnswer.Clear()
  418.           txtAnswer.Focus()
  419.           failNum += 1
  420.         End If
  421.       End If
  422.       If rtbQuestion.Text = "What port does RDP use?" Then
  423.         If txtAnswer.Text = "3389" Then
  424.           rtbQuestion.Text = "Correct! Remote Desktop Protocol uses port 3389"
  425.           score += 1
  426.           txtScore.Text = score & scoreTotal
  427.         ElseIf txtAnswer.Text = "" Then 'Fixes undesirable functionality where accidentaly hitting enter or submit answer before typing one will raise the fail counter.
  428.           My.Computer.Audio.PlaySystemSound(Media.SystemSounds.Hand)
  429.           MessageBox.Show("You didn't enter anything!", "Error")
  430.           txtAnswer.Focus()
  431.         Else
  432.           My.Computer.Audio.PlaySystemSound(Media.SystemSounds.Hand)
  433.           MessageBox.Show("Wrong, please try again. (Provide ports as integers please)", "Oops!")
  434.           txtAnswer.Clear()
  435.           txtAnswer.Focus()
  436.           failNum += 1
  437.         End If
  438.       End If
  439.       If rtbQuestion.Text = "What port is used by Syslog?" Then
  440.         If txtAnswer.Text = "514" Then
  441.           rtbQuestion.Text = "Correct! Syslog uses port 514"
  442.           score += 1
  443.           txtScore.Text = score & scoreTotal
  444.         ElseIf txtAnswer.Text = "" Then 'Fixes undesirable functionality where accidentaly hitting enter or submit answer before typing one will raise the fail counter.
  445.           My.Computer.Audio.PlaySystemSound(Media.SystemSounds.Hand)
  446.           MessageBox.Show("You didn't enter anything!", "Error")
  447.           txtAnswer.Focus()
  448.         Else
  449.           My.Computer.Audio.PlaySystemSound(Media.SystemSounds.Hand)
  450.           MessageBox.Show("Wrong, please try again. (Provide ports as integers please)", "Oops!")
  451.           txtAnswer.Clear()
  452.           txtAnswer.Focus()
  453.           failNum += 1
  454.         End If
  455.       End If
  456.       If rtbQuestion.Text = "What port does LDAP operate on?" Then
  457.         If txtAnswer.Text = "389" Then
  458.           rtbQuestion.Text = "Correct! Lightweight Directory Access Protocol uses port 389"
  459.           score += 1
  460.           txtScore.Text = score & scoreTotal
  461.         ElseIf txtAnswer.Text = "" Then 'Fixes undesirable functionality where accidentaly hitting enter or submit answer before typing one will raise the fail counter.
  462.           My.Computer.Audio.PlaySystemSound(Media.SystemSounds.Hand)
  463.           MessageBox.Show("You didn't enter anything!", "Error")
  464.           txtAnswer.Focus()
  465.         Else
  466.           My.Computer.Audio.PlaySystemSound(Media.SystemSounds.Hand)
  467.           MessageBox.Show("Wrong, please try again. (Provide ports as integers please)", "Oops!")
  468.           txtAnswer.Clear()
  469.           txtAnswer.Focus()
  470.           failNum += 1
  471.         End If
  472.       End If
  473.       If rtbQuestion.Text = "What port does a DHCP server use?" Then
  474.         If txtAnswer.Text = "67" Then
  475.           rtbQuestion.Text = "Correct! A Dynamic Host Configuration Protocol Server uses port 67"
  476.           score += 1
  477.           txtScore.Text = score & scoreTotal
  478.         ElseIf txtAnswer.Text = "" Then 'Fixes undesirable functionality where accidentaly hitting enter or submit answer before typing one will raise the fail counter.
  479.           My.Computer.Audio.PlaySystemSound(Media.SystemSounds.Hand)
  480.           MessageBox.Show("You didn't enter anything!", "Error")
  481.           txtAnswer.Focus()
  482.         Else
  483.           My.Computer.Audio.PlaySystemSound(Media.SystemSounds.Hand)
  484.           MessageBox.Show("Wrong, please try again. (Provide ports as integers please)", "Oops!")
  485.           txtAnswer.Clear()
  486.           txtAnswer.Focus()
  487.           failNum += 1
  488.         End If
  489.       End If
  490.       If rtbQuestion.Text = "What port does a DHCP client use?" Then
  491.         If txtAnswer.Text = "68" Then
  492.           rtbQuestion.Text = "Correct! A Dynamic Host Configuration Protocol Client uses port 68"
  493.           score += 1
  494.           txtScore.Text = score & scoreTotal
  495.         ElseIf txtAnswer.Text = "" Then 'Fixes undesirable functionality where accidentaly hitting enter or submit answer before typing one will raise the fail counter.
  496.           My.Computer.Audio.PlaySystemSound(Media.SystemSounds.Hand)
  497.           MessageBox.Show("You didn't enter anything!", "Error")
  498.           txtAnswer.Focus()
  499.         Else
  500.           My.Computer.Audio.PlaySystemSound(Media.SystemSounds.Hand)
  501.           MessageBox.Show("Wrong, please try again. (Provide ports as integers please)", "Oops!")
  502.           txtAnswer.Clear()
  503.           txtAnswer.Focus()
  504.           failNum += 1
  505.         End If
  506.       End If
  507.       If rtbQuestion.Text = "What port is used by DNS?" Then
  508.         If txtAnswer.Text = "53" Then
  509.           rtbQuestion.Text = "Correct! Domain Name System uses port 53"
  510.           score += 1
  511.           txtScore.Text = score & scoreTotal
  512.         ElseIf txtAnswer.Text = "" Then 'Fixes undesirable functionality where accidentaly hitting enter or submit answer before typing one will raise the fail counter.
  513.           My.Computer.Audio.PlaySystemSound(Media.SystemSounds.Hand)
  514.           MessageBox.Show("You didn't enter anything!", "Error")
  515.           txtAnswer.Focus()
  516.         Else
  517.           My.Computer.Audio.PlaySystemSound(Media.SystemSounds.Hand)
  518.           MessageBox.Show("Wrong, please try again. (Provide ports as integers please)", "Oops!")
  519.           txtAnswer.Clear()
  520.           txtAnswer.Focus()
  521.           failNum += 1
  522.         End If
  523.       End If
  524.       If rtbQuestion.Text = "What port is used by SFTP?" Then
  525.         If txtAnswer.Text = "22" Then
  526.           rtbQuestion.Text = "Correct! Secure File Transfer Protocol uses port 22"
  527.           score += 1
  528.           txtScore.Text = score & scoreTotal
  529.         ElseIf txtAnswer.Text = "" Then 'Fixes undesirable functionality where accidentaly hitting enter or submit answer before typing one will raise the fail counter.
  530.           My.Computer.Audio.PlaySystemSound(Media.SystemSounds.Hand)
  531.           MessageBox.Show("You didn't enter anything!", "Error")
  532.           txtAnswer.Focus()
  533.         Else
  534.           My.Computer.Audio.PlaySystemSound(Media.SystemSounds.Hand)
  535.           MessageBox.Show("Wrong, please try again. (Provide ports as integers please)", "Oops!")
  536.           txtAnswer.Clear()
  537.           txtAnswer.Focus()
  538.           failNum += 1
  539.         End If
  540.       End If
  541.       If rtbQuestion.Text = "What port does SCP use?" Then
  542.         If txtAnswer.Text = "22" Then
  543.           rtbQuestion.Text = "Correct! Secure Copy uses port 22"
  544.           score += 1
  545.           txtScore.Text = score & scoreTotal
  546.         ElseIf txtAnswer.Text = "" Then 'Fixes undesirable functionality where accidentaly hitting enter or submit answer before typing one will raise the fail counter.
  547.           My.Computer.Audio.PlaySystemSound(Media.SystemSounds.Hand)
  548.           MessageBox.Show("You didn't enter anything!", "Error")
  549.           txtAnswer.Focus()
  550.         Else
  551.           My.Computer.Audio.PlaySystemSound(Media.SystemSounds.Hand)
  552.           MessageBox.Show("Wrong, please try again. (Provide ports as integers please)", "Oops!")
  553.           txtAnswer.Clear()
  554.           txtAnswer.Focus()
  555.           failNum += 1
  556.         End If
  557.       End If
  558.       If rtbQuestion.Text = "What port is used by SNMP?" Then
  559.         If txtAnswer.Text = "161" Then
  560.           rtbQuestion.Text = "Correct! Simple Network Managment Protocol uses port 161"
  561.           score += 1
  562.           txtScore.Text = score & scoreTotal
  563.         ElseIf txtAnswer.Text = "" Then 'Fixes undesirable functionality where accidentaly hitting enter or submit answer before typing one will raise the fail counter.
  564.           My.Computer.Audio.PlaySystemSound(Media.SystemSounds.Hand)
  565.           MessageBox.Show("You didn't enter anything!", "Error")
  566.           txtAnswer.Focus()
  567.         Else
  568.           My.Computer.Audio.PlaySystemSound(Media.SystemSounds.Hand)
  569.           MessageBox.Show("Wrong, please try again. (Provide ports as integers please)", "Oops!")
  570.           txtAnswer.Clear()
  571.           txtAnswer.Focus()
  572.           failNum += 1
  573.         End If
  574.       End If
  575.       If rtbQuestion.Text = "What port is used by SNMP Trap?" Then
  576.         If txtAnswer.Text = "162" Then
  577.           rtbQuestion.Text = "Correct! Simple Network Management Protocol Trap uses port 162"
  578.           score += 1
  579.           txtScore.Text = score & scoreTotal
  580.         ElseIf txtAnswer.Text = "" Then 'Fixes undesirable functionality where accidentaly hitting enter or submit answer before typing one will raise the fail counter.
  581.           My.Computer.Audio.PlaySystemSound(Media.SystemSounds.Hand)
  582.           MessageBox.Show("You didn't enter anything!", "Error")
  583.           txtAnswer.Focus()
  584.         Else
  585.           My.Computer.Audio.PlaySystemSound(Media.SystemSounds.Hand)
  586.           MessageBox.Show("Wrong, please try again. (Provide ports as integers please)", "Oops!")
  587.           txtAnswer.Clear()
  588.           txtAnswer.Focus()
  589.           failNum += 1
  590.         End If
  591.       End If
  592.       If rtbQuestion.Text = "What port does IMAP4 use?" Then
  593.         If txtAnswer.Text = "143" Then
  594.           rtbQuestion.Text = "Correct! Internet Message Access Protocol version 4 uses port 143"
  595.           score += 1
  596.           txtScore.Text = score & scoreTotal
  597.         ElseIf txtAnswer.Text = "" Then 'Fixes undesirable functionality where accidentaly hitting enter or submit answer before typing one will raise the fail counter.
  598.           My.Computer.Audio.PlaySystemSound(Media.SystemSounds.Hand)
  599.           MessageBox.Show("You didn't enter anything!", "Error")
  600.           txtAnswer.Focus()
  601.         Else
  602.           My.Computer.Audio.PlaySystemSound(Media.SystemSounds.Hand)
  603.           MessageBox.Show("Wrong, please try again. (Provide ports as integers please)", "Oops!")
  604.           txtAnswer.Clear()
  605.           txtAnswer.Focus()
  606.           failNum += 1
  607.         End If
  608.       End If
  609.       If rtbQuestion.Text = "What port is used by IPsec?" Then
  610.         If txtAnswer.Text = "500" Then
  611.           rtbQuestion.Text = "Correct! Internet Protocol Security uses port 500"
  612.           score += 1
  613.           txtScore.Text = score & scoreTotal
  614.         ElseIf txtAnswer.Text = "" Then 'Fixes undesirable functionality where accidentaly hitting enter or submit answer before typing one will raise the fail counter.
  615.           My.Computer.Audio.PlaySystemSound(Media.SystemSounds.Hand)
  616.           MessageBox.Show("You didn't enter anything!", "Error")
  617.           txtAnswer.Focus()
  618.         Else
  619.           My.Computer.Audio.PlaySystemSound(Media.SystemSounds.Hand)
  620.           MessageBox.Show("Wrong, please try again. (Provide ports as integers please)", "Oops!")
  621.           txtAnswer.Clear()
  622.           txtAnswer.Focus()
  623.           failNum += 1
  624.         End If
  625.       End If
  626.       If txtScore.Text = "27/27" Then 'handles a pass state for the port number quiz.
  627.         My.Computer.Audio.PlaySystemSound(Media.SystemSounds.Exclamation)
  628.         MessageBox.Show("Good Job! Go get certified!", "Congratulations!")
  629.         subjectComplete += 1
  630.         txtAnswer.Clear()
  631.         rtbQuestion.Clear()
  632.         lstSubject.Items.Clear()
  633.         txtScore.Clear()
  634.         lblAnswer.Visible = False
  635.         txtAnswer.Visible = False
  636.         btnNext.Visible = False
  637.         btnPrev.Visible = False
  638.         rtbQuestion.Visible = False
  639.         btnAnswer.Visible = False
  640.         lstSubject.Items.AddRange(IO.File.ReadAllLines("F:\My Stuff\Visual Basic Projects\Port Number Quiz TS Challenge v0.1\lstSubject.txt"))
  641.         'resets program upon passing a subject, and sets an invisible score for future quizes.
  642.       End If
  643.       If failNum = 10 Then
  644.         My.Computer.Audio.PlaySystemSound(Media.SystemSounds.Asterisk)
  645.         MessageBox.Show("Oops, seems you need to study more!", "RIP")
  646.         txtAnswer.Clear()
  647.         txtScore.Clear()
  648.         rtbQuestion.Clear()
  649.         rtbQuestion.Text = "What port does HTTP operate over?"
  650.         failNum = 0
  651.         'Resets quiz upon failure (10 failed answers)
  652.       End If
  653.     End If
  654.   End Sub
  655.   '^^^^^ I'm aware this block of code is probably painfully atrocious in terms of how tedious it is, and it's probably horrifying to think how easy it would -
  656.   'be to condense it with a function, sub, array, etc. But until I learn more about those this is the best I could come up with, and I look forward to updating it.
  657.  
  658.   Private Sub btnNext_Click(sender As Object, e As EventArgs) Handles btnNext.Click
  659.     txtAnswer.Clear()
  660.     txtAnswer.Focus()
  661.     Select Case rtbQuestion.Text 'handles fetching next answer if the previous question was answered correctly. This block of code -
  662.       'fits tightly together with the btnAnswer.click sub and the btnPrev.click sub like an interwoven mesh. It is incredibly deliberate.
  663.       'This case block tests to see if you answered the previous question correctly based on the contents of rtbQuestion, and then presents the next question.
  664.       Case "Correct! HyperText Transfer Protocol operates on port 80"
  665.         rtbQuestion.Text = "What port does FTP operate on?"
  666.       Case "Correct! File Transfer Protocol operates on port 21"
  667.         rtbQuestion.Text = "What port does POP3 operate on?"
  668.       Case "Correct! POP3 operates on port 110"
  669.         rtbQuestion.Text = "What port does HTTPS operate over?"
  670.       Case "Correct! HyperText Transfer Protocol Secure operates on port 443"
  671.         rtbQuestion.Text = "What port does SMTP operate on?"
  672.       Case "Correct! Simple Mail Transfer Protocol operates on port 25"
  673.         rtbQuestion.Text = "What port does TELNET operate over?"
  674.       Case "Correct! TELNET operates on port 23"
  675.         rtbQuestion.Text = "What port is used by IPsec?"
  676.       Case "Correct! Internet Protocol Security uses port 500"
  677.         rtbQuestion.Text = "What port is used by DNS?"
  678.       Case "Correct! Domain Name System uses port 53"
  679.         rtbQuestion.Text = "What port is used by SNMP?"
  680.       Case "Correct! Simple Network Managment Protocol uses port 161"
  681.         rtbQuestion.Text = "What port does LDAP operate on?"
  682.       Case "Correct! Lightweight Directory Access Protocol uses port 389"
  683.         rtbQuestion.Text = "What port is used by SFTP?"
  684.       Case "Correct! Secure File Transfer Protocol uses port 22"
  685.         rtbQuestion.Text = "What port does a DHCP client use?"
  686.       Case "Correct! A Dynamic Host Configuration Protocol Client uses port 68"
  687.         rtbQuestion.Text = "What port does PPTP use?"
  688.       Case "Correct! Point-to-Point Tunneling Protocol uses port 1723"
  689.         rtbQuestion.Text = "What port does RDP use?"
  690.       Case "Correct! Remote Desktop Protocol uses port 3389"
  691.         rtbQuestion.Text = "What port does Kerberos use?"
  692.       Case "Correct! Kerberos uses port 88"
  693.         rtbQuestion.Text = "What port is used by SNMP Trap?"
  694.       Case "Correct! Simple Network Management Protocol Trap uses port 162"
  695.         rtbQuestion.Text = "What port does IMAP4 use?"
  696.       Case "Correct! Internet Message Access Protocol version 4 uses port 143"
  697.         rtbQuestion.Text = "What port is used by Syslog?"
  698.       Case "Correct! Syslog uses port 514"
  699.         rtbQuestion.Text = "What port does a DHCP server use?"
  700.       Case "Correct! A Dynamic Host Configuration Protocol Server uses port 67"
  701.         rtbQuestion.Text = "What port does SCP use?"
  702.       Case "Correct! Secure Copy uses port 22"
  703.         rtbQuestion.Text = "What port does L2TP operate on?"
  704.       Case "Correct! Layer 2 Tunneling Protocol uses port 1701"
  705.         rtbQuestion.Text = "What port does SSL VPN operate over?"
  706.       Case "Correct! SSL VPN uses port 443"
  707.         rtbQuestion.Text = "What port does TACACS use?"
  708.       Case "Correct! Terminal Access Controller Access-Control System uses port 49"
  709.         rtbQuestion.Text = "What port does NTP operate on?"
  710.       Case "Correct! Network Time Protocol uses port 123"
  711.         rtbQuestion.Text = "What port does SSH use?"
  712.       Case "Correct! Secure Shell uses port 22"
  713.         rtbQuestion.Text = "What port does NNTP operate over?"
  714.       Case "Correct! Network News Transfer Protocol uses port 119"
  715.         rtbQuestion.Text = "What port does TFTP operate on?"
  716.       Case "Correct! Trivial File Transport Protocol uses port 69"
  717.  
  718.     End Select
  719.   End Sub
  720.  
  721.   Private Sub btnPrev_Click(sender As Object, e As EventArgs) Handles btnPrev.Click
  722.     txtAnswer.Clear()
  723.     txtAnswer.Focus()
  724.     Select Case rtbQuestion.Text 'Allows user to return to previously passed questions (for whatever reason)
  725.       'This case block tests if you have answered the current question correctly, and then transfers you to the previous one regardless
  726.       Case "Correct! Trivial File Transport Protocol uses port 69", "What port does TFTP operate on?"
  727.         If rtbQuestion.Text = "Correct! Trivial File Transport Protocol uses port 69" Then 'penalizes score for backpedaling. Prevents score exploit to pass quiz -
  728.           'without answering all questions.
  729.           score -= 2
  730.         Else
  731.           score -= 1
  732.         End If
  733.         rtbQuestion.Text = "What port does NNTP operate over?"
  734.         txtScore.Text = score & scoreTotal
  735.       Case "Correct! Network News Transfer Protocol uses port 119", "What port does NNTP operate over?"
  736.         If rtbQuestion.Text = "Correct! Network News Transfer Protocol uses port 119" Then
  737.           score -= 2
  738.         Else
  739.           score -= 1
  740.         End If
  741.         rtbQuestion.Text = "What port does SSH use?"
  742.         txtScore.Text = score & scoreTotal
  743.       Case "Correct! Secure Shell uses port 22", "What port does SSH use?"
  744.         If rtbQuestion.Text = "Correct! Secure Shell uses port 22" Then
  745.           score -= 2
  746.         Else
  747.           score -= 1
  748.         End If
  749.         rtbQuestion.Text = "What port does NTP operate on?"
  750.         txtScore.Text = score & scoreTotal
  751.       Case "Correct! Network Time Protocol uses port 123", "What port does NTP operate on?"
  752.         If rtbQuestion.Text = "Correct! Network Time Protocol uses port 123" Then
  753.           score -= 2
  754.         Else
  755.           score -= 1
  756.         End If
  757.         rtbQuestion.Text = "What port does TACACS use?"
  758.         txtScore.Text = score & scoreTotal
  759.       Case "Correct! Terminal Access Controller Access-Control System uses port 49", "What port does TACACS use?"
  760.         If rtbQuestion.Text = "Correct! Terminal Access Controller Access-Control System uses port 49" Then
  761.           score -= 2
  762.         Else
  763.           score -= 1
  764.         End If
  765.         rtbQuestion.Text = "What port does SSL VPN operate over?"
  766.         txtScore.Text = score & scoreTotal
  767.       Case "What port does SSL VPN operate over?", "Correct! SSL VPN uses port 443"
  768.         If rtbQuestion.Text = "Correct! SSL VPN uses port 443" Then
  769.           score -= 2
  770.         Else
  771.           score -= 1
  772.         End If
  773.         rtbQuestion.Text = "What port does L2TP operate on?"
  774.         txtScore.Text = score & scoreTotal
  775.       Case "What port does L2TP operate on?", "Correct! Layer 2 Tunneling Protocol uses port 1701"
  776.         If rtbQuestion.Text = "Correct! Layer 2 Tunneling Protocol uses port 1701" Then
  777.           score -= 2
  778.         Else
  779.           score -= 1
  780.         End If
  781.         rtbQuestion.Text = "What port does SCP use?"
  782.         txtScore.Text = score & scoreTotal
  783.       Case "What port does SCP use?", "Correct! Secure Copy uses port 22"
  784.         If rtbQuestion.Text = "Correct! Secure Copy uses port 22" Then
  785.           score -= 2
  786.         Else
  787.           score -= 1
  788.         End If
  789.         rtbQuestion.Text = "What port does a DHCP server use?"
  790.         txtScore.Text = score & scoreTotal
  791.       Case "What port does a DHCP server use?", "Correct! A Dynamic Host Configuration Protocol Server uses port 67"
  792.         If rtbQuestion.Text = "Correct! A Dynamic Host Configuration Protocol Server uses port 67" Then
  793.           score -= 2
  794.         Else
  795.           score -= 1
  796.         End If
  797.         rtbQuestion.Text = "What port is used by Syslog?"
  798.         txtScore.Text = score & scoreTotal
  799.       Case "What port is used by Syslog?", "Correct! Syslog uses port 514"
  800.         If rtbQuestion.Text = "Correct! Syslog uses port 514" Then
  801.           score -= 2
  802.         Else
  803.           score -= 1
  804.         End If
  805.         rtbQuestion.Text = "What port does IMAP4 use?"
  806.         txtScore.Text = score & scoreTotal
  807.       Case "What port does IMAP4 use?", "Correct! Internet Message Access Protocol version 4 uses port 143"
  808.         If rtbQuestion.Text = "Correct! Internet Message Access Protocol version 4 uses port 143" Then
  809.           score -= 2
  810.         Else
  811.           score -= 1
  812.         End If
  813.         rtbQuestion.Text = "What port is used by SNMP Trap?"
  814.         txtScore.Text = score & scoreTotal
  815.       Case "What port is used by SNMP Trap?", "Correct! Simple Network Management Protocol Trap uses port 162"
  816.         If rtbQuestion.Text = "Correct! Simple Network Management Protocol Trap uses port 162" Then
  817.           score -= 2
  818.         Else
  819.           score -= 1
  820.         End If
  821.         rtbQuestion.Text = "What port does Kerberos use?"
  822.         txtScore.Text = score & scoreTotal
  823.       Case "What port does Kerberos use?", "Correct! Kerberos uses port 88"
  824.         If rtbQuestion.Text = "Correct! Kerberos uses port 88" Then
  825.           score -= 2
  826.         Else
  827.           score -= 1
  828.         End If
  829.         rtbQuestion.Text = "What port does RDP use?"
  830.         txtScore.Text = score & scoreTotal
  831.       Case "What port does RDP use?", "Correct! Remote Desktop Protocol uses port 3389"
  832.         If rtbQuestion.Text = "Correct! Remote Desktop Protocol uses port 3389" Then
  833.           score -= 2
  834.         Else
  835.           score -= 1
  836.         End If
  837.         rtbQuestion.Text = "What port does PPTP use?"
  838.         txtScore.Text = score & scoreTotal
  839.       Case "What port does PPTP use?", "Correct! Point-to-Point Tunneling Protocol uses port 1723"
  840.         If rtbQuestion.Text = "Correct! Point-to-Point Tunneling Protocol uses port 1723" Then
  841.           score -= 2
  842.         Else
  843.           score -= 1
  844.         End If
  845.         rtbQuestion.Text = "What port does a DHCP client use?"
  846.         txtScore.Text = score & scoreTotal
  847.       Case "What port does a DHCP client use?", "Correct! A Dynamic Host Configuration Protocol Client uses port 68"
  848.         If rtbQuestion.Text = "Correct! A Dynamic Host Configuration Protocol Client uses port 68" Then
  849.           score -= 2
  850.         Else
  851.           score -= 1
  852.         End If
  853.         rtbQuestion.Text = "What port is used by SFTP?"
  854.         txtScore.Text = score & scoreTotal
  855.       Case "What port is used by SFTP?", "Correct! Secure File Transfer Protocol uses port 22"
  856.         If rtbQuestion.Text = "Correct! Secure File Transfer Protocol uses port 22" Then
  857.           score -= 2
  858.         Else
  859.           score -= 1
  860.         End If
  861.         rtbQuestion.Text = "What port does LDAP operate on?"
  862.         txtScore.Text = score & scoreTotal
  863.       Case "What port does LDAP operate on?", "Correct! Lightweight Directory Access Protocol uses port 389"
  864.         If rtbQuestion.Text = "Correct! Lightweight Directory Access Protocol uses port 389" Then
  865.           score -= 2
  866.         Else
  867.           score -= 1
  868.         End If
  869.         rtbQuestion.Text = "What port is used by SNMP?"
  870.         txtScore.Text = score & "/27"
  871.       Case "What port is used by SNMP?", "Correct! Simple Network Managment Protocol uses port 161"
  872.         If rtbQuestion.Text = "Correct! Simple Network Managment Protocol uses port 161" Then
  873.           score -= 2
  874.         Else
  875.           score -= 1
  876.         End If
  877.         rtbQuestion.Text = "What port is used by DNS?"
  878.         txtScore.Text = score & scoreTotal
  879.       Case "What port is used by DNS?", "Correct! Domain Name System uses port 53"
  880.         If rtbQuestion.Text = "Correct! Domain Name System uses port 53" Then
  881.           score -= 2
  882.         Else
  883.           score -= 1
  884.         End If
  885.         rtbQuestion.Text = "What port is used by IPsec?"
  886.         txtScore.Text = score & scoreTotal
  887.       Case "What port is used by IPsec?", "Correct! Internet Protocol Security uses port 500"
  888.         If rtbQuestion.Text = "Correct! Internet Protocol Security uses port 500" Then
  889.           score -= 2
  890.         Else
  891.           score -= 1
  892.         End If
  893.         rtbQuestion.Text = "What port does TELNET operate over?"
  894.         txtScore.Text = score & scoreTotal
  895.       Case "What port does TELNET operate over?", "Correct! TELNET operates on port 23"
  896.         If rtbQuestion.Text = "Correct! TELNET operates on port 23" Then
  897.           score -= 2
  898.         Else
  899.           score -= 1
  900.         End If
  901.         rtbQuestion.Text = "What port does SMTP operate on?"
  902.         txtScore.Text = score & scoreTotal
  903.       Case "What port does SMTP operate on?", "Correct! Simple Mail Transfer Protocol operates on port 25"
  904.         If rtbQuestion.Text = "Correct! Simple Mail Transfer Protocol operates on port 25" Then
  905.           score -= 2
  906.         Else
  907.           score -= 1
  908.         End If
  909.         rtbQuestion.Text = "What port does HTTPS operate over?"
  910.         txtScore.Text = score & scoreTotal
  911.       Case "What port does HTTPS operate over?", "Correct! HyperText Transfer Protocol Secure operates on port 443"
  912.         If rtbQuestion.Text = "Correct! HyperText Transfer Protocol Secure operates on port 443" Then
  913.           score -= 2
  914.         Else
  915.           score -= 1
  916.         End If
  917.         rtbQuestion.Text = "What port does POP3 operate on?"
  918.         txtScore.Text = score & scoreTotal
  919.       Case "What port does POP3 operate on?", "Correct! POP3 operates on port 110"
  920.         If rtbQuestion.Text = "Correct! POP3 operates on port 110" Then
  921.           score -= 2
  922.         Else
  923.           score -= 1
  924.         End If
  925.         rtbQuestion.Text = "What port does FTP operate on?"
  926.         txtScore.Text = score & scoreTotal
  927.       Case "What port does FTP operate on?", "Correct! File Transfer Protocol operates on port 21"
  928.         If rtbQuestion.Text = "Correct! File Transfer Protocol operates on port 21" Then
  929.           score -= 2
  930.         Else
  931.           score -= 1
  932.         End If
  933.         rtbQuestion.Text = "What port does HTTP operate over?"
  934.         txtScore.Text = score & scoreTotal
  935.       Case "Correct! HyperText Transfer Protocol operates on port 80"
  936.         rtbQuestion.Text = "What port does HTTP operate over?"
  937.         score -= 1
  938.         txtScore.Text = score & scoreTotal
  939.     End Select
  940.   End Sub
  941.  
  942.  
  943.  
  944. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement