Questo sito utilizza cookies solo per scopi di autenticazione sul sito e nient'altro. Nessuna informazione personale viene tracciata. Leggi l'informativa sui cookies.
Username: Password: oppure
Benchmark Semplice - Form1.vb

Form1.vb

Caricato da:
Scarica il programma completo

  1. Public Class Form1
  2.     Inherits System.Windows.Forms.Form
  3.     Dim ora As String
  4.  
  5. #Region " Codice generato da Progettazione Windows Form "
  6.  
  7.     Public Sub New()
  8.         MyBase.New()
  9.  
  10.         'Chiamata richiesta da Progettazione Windows Form.
  11.         InitializeComponent()
  12.  
  13.         'Aggiungere le eventuali istruzioni di inizializzazione dopo la chiamata a InitializeComponent()
  14.  
  15.     End Sub
  16.  
  17.     'Form esegue l'override del metodo Dispose per pulire l'elenco dei componenti.
  18.     Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
  19.         If disposing Then
  20.             If Not (components Is Nothing) Then
  21.                 components.Dispose()
  22.             End If
  23.         End If
  24.         MyBase.Dispose(disposing)
  25.     End Sub
  26.  
  27.     'Richiesto da Progettazione Windows Form
  28.     Private components As System.ComponentModel.IContainer
  29.  
  30.     'NOTA: la procedura che segue è richiesta da Progettazione Windows Form.
  31.     'Può essere modificata in Progettazione Windows Form.  
  32.     'Non modificarla nell'editor del codice.
  33.     Friend WithEvents Button1 As System.Windows.Forms.Button
  34.     Friend WithEvents ProgressBar1 As System.Windows.Forms.ProgressBar
  35.     Friend WithEvents TextBox1 As System.Windows.Forms.TextBox
  36.     Friend WithEvents GroupBox1 As System.Windows.Forms.GroupBox
  37.     Friend WithEvents Label1 As System.Windows.Forms.Label
  38.     Friend WithEvents Label2 As System.Windows.Forms.Label
  39.     Friend WithEvents Label3 As System.Windows.Forms.Label
  40.     Friend WithEvents Label4 As System.Windows.Forms.Label
  41.     Friend WithEvents Button2 As System.Windows.Forms.Button
  42.     Friend WithEvents Button3 As System.Windows.Forms.Button
  43.     Friend WithEvents GroupBox2 As System.Windows.Forms.GroupBox
  44.     Friend WithEvents Label5 As System.Windows.Forms.Label
  45.     Friend WithEvents Label6 As System.Windows.Forms.Label
  46.     Friend WithEvents Label7 As System.Windows.Forms.Label
  47.     Friend WithEvents Label8 As System.Windows.Forms.Label
  48.     Friend WithEvents GroupBox3 As System.Windows.Forms.GroupBox
  49.     Friend WithEvents Label9 As System.Windows.Forms.Label
  50.     Friend WithEvents Label10 As System.Windows.Forms.Label
  51.     Friend WithEvents Label11 As System.Windows.Forms.Label
  52.     Friend WithEvents Label12 As System.Windows.Forms.Label
  53.     Friend WithEvents Button4 As System.Windows.Forms.Button
  54.     <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
  55.         Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(Form1))
  56.         Me.Button1 = New System.Windows.Forms.Button
  57.         Me.ProgressBar1 = New System.Windows.Forms.ProgressBar
  58.         Me.TextBox1 = New System.Windows.Forms.TextBox
  59.         Me.GroupBox1 = New System.Windows.Forms.GroupBox
  60.         Me.Label4 = New System.Windows.Forms.Label
  61.         Me.Label3 = New System.Windows.Forms.Label
  62.         Me.Label2 = New System.Windows.Forms.Label
  63.         Me.Label1 = New System.Windows.Forms.Label
  64.         Me.Button2 = New System.Windows.Forms.Button
  65.         Me.Button3 = New System.Windows.Forms.Button
  66.         Me.GroupBox2 = New System.Windows.Forms.GroupBox
  67.         Me.Label5 = New System.Windows.Forms.Label
  68.         Me.Label6 = New System.Windows.Forms.Label
  69.         Me.Label7 = New System.Windows.Forms.Label
  70.         Me.Label8 = New System.Windows.Forms.Label
  71.         Me.GroupBox3 = New System.Windows.Forms.GroupBox
  72.         Me.Label9 = New System.Windows.Forms.Label
  73.         Me.Label10 = New System.Windows.Forms.Label
  74.         Me.Label11 = New System.Windows.Forms.Label
  75.         Me.Label12 = New System.Windows.Forms.Label
  76.         Me.Button4 = New System.Windows.Forms.Button
  77.         Me.GroupBox1.SuspendLayout()
  78.         Me.GroupBox2.SuspendLayout()
  79.         Me.GroupBox3.SuspendLayout()
  80.         Me.SuspendLayout()
  81.         '
  82.         'Button1
  83.         '
  84.         Me.Button1.FlatStyle = System.Windows.Forms.FlatStyle.System
  85.         Me.Button1.Location = New System.Drawing.Point(200, 32)
  86.         Me.Button1.Name = "Button1"
  87.         Me.Button1.Size = New System.Drawing.Size(80, 23)
  88.         Me.Button1.TabIndex = 0
  89.         Me.Button1.Text = "Livello 1"
  90.         '
  91.         'ProgressBar1
  92.         '
  93.         Me.ProgressBar1.Location = New System.Drawing.Point(8, 8)
  94.         Me.ProgressBar1.Maximum = 12001
  95.         Me.ProgressBar1.Name = "ProgressBar1"
  96.         Me.ProgressBar1.Size = New System.Drawing.Size(624, 16)
  97.         Me.ProgressBar1.Step = 1
  98.         Me.ProgressBar1.TabIndex = 1
  99.         '
  100.         'TextBox1
  101.         '
  102.         Me.TextBox1.Location = New System.Drawing.Point(16, 32)
  103.         Me.TextBox1.MaxLength = 999999
  104.         Me.TextBox1.Multiline = True
  105.         Me.TextBox1.Name = "TextBox1"
  106.         Me.TextBox1.ScrollBars = System.Windows.Forms.ScrollBars.Vertical
  107.         Me.TextBox1.Size = New System.Drawing.Size(8, 8)
  108.         Me.TextBox1.TabIndex = 2
  109.         Me.TextBox1.Text = ""
  110.         Me.TextBox1.Visible = False
  111.         '
  112.         'GroupBox1
  113.         '
  114.         Me.GroupBox1.Controls.Add(Me.Label4)
  115.         Me.GroupBox1.Controls.Add(Me.Label3)
  116.         Me.GroupBox1.Controls.Add(Me.Label2)
  117.         Me.GroupBox1.Controls.Add(Me.Label1)
  118.         Me.GroupBox1.FlatStyle = System.Windows.Forms.FlatStyle.System
  119.         Me.GroupBox1.Location = New System.Drawing.Point(8, 56)
  120.         Me.GroupBox1.Name = "GroupBox1"
  121.         Me.GroupBox1.Size = New System.Drawing.Size(208, 56)
  122.         Me.GroupBox1.TabIndex = 3
  123.         Me.GroupBox1.TabStop = False
  124.         Me.GroupBox1.Text = "Resoconto 1° Livello"
  125.         '
  126.         'Label4
  127.         '
  128.         Me.Label4.Location = New System.Drawing.Point(112, 32)
  129.         Me.Label4.Name = "Label4"
  130.         Me.Label4.Size = New System.Drawing.Size(88, 16)
  131.         Me.Label4.TabIndex = 3
  132.         Me.Label4.TextAlign = System.Drawing.ContentAlignment.TopCenter
  133.         '
  134.         'Label3
  135.         '
  136.         Me.Label3.Location = New System.Drawing.Point(8, 32)
  137.         Me.Label3.Name = "Label3"
  138.         Me.Label3.Size = New System.Drawing.Size(104, 16)
  139.         Me.Label3.TabIndex = 2
  140.         Me.Label3.Text = "Test Terminato alle"
  141.         '
  142.         'Label2
  143.         '
  144.         Me.Label2.Location = New System.Drawing.Point(112, 16)
  145.         Me.Label2.Name = "Label2"
  146.         Me.Label2.Size = New System.Drawing.Size(88, 16)
  147.         Me.Label2.TabIndex = 1
  148.         Me.Label2.TextAlign = System.Drawing.ContentAlignment.TopCenter
  149.         '
  150.         'Label1
  151.         '
  152.         Me.Label1.Location = New System.Drawing.Point(8, 16)
  153.         Me.Label1.Name = "Label1"
  154.         Me.Label1.Size = New System.Drawing.Size(88, 16)
  155.         Me.Label1.TabIndex = 0
  156.         Me.Label1.Text = "Test iniziato alle"
  157.         '
  158.         'Button2
  159.         '
  160.         Me.Button2.Enabled = False
  161.         Me.Button2.FlatStyle = System.Windows.Forms.FlatStyle.System
  162.         Me.Button2.Location = New System.Drawing.Point(280, 32)
  163.         Me.Button2.Name = "Button2"
  164.         Me.Button2.Size = New System.Drawing.Size(80, 23)
  165.         Me.Button2.TabIndex = 4
  166.         Me.Button2.Text = "Livello 2"
  167.         '
  168.         'Button3
  169.         '
  170.         Me.Button3.Enabled = False
  171.         Me.Button3.FlatStyle = System.Windows.Forms.FlatStyle.System
  172.         Me.Button3.Location = New System.Drawing.Point(360, 32)
  173.         Me.Button3.Name = "Button3"
  174.         Me.Button3.Size = New System.Drawing.Size(80, 23)
  175.         Me.Button3.TabIndex = 5
  176.         Me.Button3.Text = "Livello 3"
  177.         '
  178.         'GroupBox2
  179.         '
  180.         Me.GroupBox2.Controls.Add(Me.Label5)
  181.         Me.GroupBox2.Controls.Add(Me.Label6)
  182.         Me.GroupBox2.Controls.Add(Me.Label7)
  183.         Me.GroupBox2.Controls.Add(Me.Label8)
  184.         Me.GroupBox2.FlatStyle = System.Windows.Forms.FlatStyle.System
  185.         Me.GroupBox2.Location = New System.Drawing.Point(216, 56)
  186.         Me.GroupBox2.Name = "GroupBox2"
  187.         Me.GroupBox2.Size = New System.Drawing.Size(208, 56)
  188.         Me.GroupBox2.TabIndex = 6
  189.         Me.GroupBox2.TabStop = False
  190.         Me.GroupBox2.Text = "Resoconto 2° Livello"
  191.         '
  192.         'Label5
  193.         '
  194.         Me.Label5.Location = New System.Drawing.Point(112, 32)
  195.         Me.Label5.Name = "Label5"
  196.         Me.Label5.Size = New System.Drawing.Size(88, 16)
  197.         Me.Label5.TabIndex = 3
  198.         Me.Label5.TextAlign = System.Drawing.ContentAlignment.TopCenter
  199.         '
  200.         'Label6
  201.         '
  202.         Me.Label6.Location = New System.Drawing.Point(8, 32)
  203.         Me.Label6.Name = "Label6"
  204.         Me.Label6.Size = New System.Drawing.Size(104, 16)
  205.         Me.Label6.TabIndex = 2
  206.         Me.Label6.Text = "Test Terminato alle"
  207.         '
  208.         'Label7
  209.         '
  210.         Me.Label7.Location = New System.Drawing.Point(112, 16)
  211.         Me.Label7.Name = "Label7"
  212.         Me.Label7.Size = New System.Drawing.Size(88, 16)
  213.         Me.Label7.TabIndex = 1
  214.         Me.Label7.TextAlign = System.Drawing.ContentAlignment.TopCenter
  215.         '
  216.         'Label8
  217.         '
  218.         Me.Label8.Location = New System.Drawing.Point(8, 16)
  219.         Me.Label8.Name = "Label8"
  220.         Me.Label8.Size = New System.Drawing.Size(88, 16)
  221.         Me.Label8.TabIndex = 0
  222.         Me.Label8.Text = "Test iniziato alle"
  223.         '
  224.         'GroupBox3
  225.         '
  226.         Me.GroupBox3.Controls.Add(Me.Label9)
  227.         Me.GroupBox3.Controls.Add(Me.Label10)
  228.         Me.GroupBox3.Controls.Add(Me.Label11)
  229.         Me.GroupBox3.Controls.Add(Me.Label12)
  230.         Me.GroupBox3.FlatStyle = System.Windows.Forms.FlatStyle.System
  231.         Me.GroupBox3.Location = New System.Drawing.Point(424, 56)
  232.         Me.GroupBox3.Name = "GroupBox3"
  233.         Me.GroupBox3.Size = New System.Drawing.Size(208, 56)
  234.         Me.GroupBox3.TabIndex = 7
  235.         Me.GroupBox3.TabStop = False
  236.         Me.GroupBox3.Text = "Resoconto 3° Livello"
  237.         '
  238.         'Label9
  239.         '
  240.         Me.Label9.Location = New System.Drawing.Point(112, 32)
  241.         Me.Label9.Name = "Label9"
  242.         Me.Label9.Size = New System.Drawing.Size(88, 16)
  243.         Me.Label9.TabIndex = 3
  244.         Me.Label9.TextAlign = System.Drawing.ContentAlignment.TopCenter
  245.         '
  246.         'Label10
  247.         '
  248.         Me.Label10.Location = New System.Drawing.Point(8, 32)
  249.         Me.Label10.Name = "Label10"
  250.         Me.Label10.Size = New System.Drawing.Size(104, 16)
  251.         Me.Label10.TabIndex = 2
  252.         Me.Label10.Text = "Test Terminato alle"
  253.         '
  254.         'Label11
  255.         '
  256.         Me.Label11.Location = New System.Drawing.Point(112, 16)
  257.         Me.Label11.Name = "Label11"
  258.         Me.Label11.Size = New System.Drawing.Size(88, 16)
  259.         Me.Label11.TabIndex = 1
  260.         Me.Label11.TextAlign = System.Drawing.ContentAlignment.TopCenter
  261.         '
  262.         'Label12
  263.         '
  264.         Me.Label12.Location = New System.Drawing.Point(8, 16)
  265.         Me.Label12.Name = "Label12"
  266.         Me.Label12.Size = New System.Drawing.Size(88, 16)
  267.         Me.Label12.TabIndex = 0
  268.         Me.Label12.Text = "Test iniziato alle"
  269.         '
  270.         'Button4
  271.         '
  272.         Me.Button4.FlatStyle = System.Windows.Forms.FlatStyle.System
  273.         Me.Button4.Location = New System.Drawing.Point(520, 32)
  274.         Me.Button4.Name = "Button4"
  275.         Me.Button4.Size = New System.Drawing.Size(112, 23)
  276.         Me.Button4.TabIndex = 8
  277.         Me.Button4.Text = "Vedi il Mio Punteggio"
  278.         '
  279.         'Form1
  280.         '
  281.         Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
  282.         Me.ClientSize = New System.Drawing.Size(638, 116)
  283.         Me.Controls.Add(Me.Button4)
  284.         Me.Controls.Add(Me.GroupBox3)
  285.         Me.Controls.Add(Me.GroupBox2)
  286.         Me.Controls.Add(Me.Button3)
  287.         Me.Controls.Add(Me.Button2)
  288.         Me.Controls.Add(Me.GroupBox1)
  289.         Me.Controls.Add(Me.TextBox1)
  290.         Me.Controls.Add(Me.ProgressBar1)
  291.         Me.Controls.Add(Me.Button1)
  292.         Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D
  293.         Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
  294.         Me.MaximizeBox = False
  295.         Me.Name = "Form1"
  296.         Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
  297.         Me.Text = "BenchMark CPU By GoLDBeRG"
  298.         Me.GroupBox1.ResumeLayout(False)
  299.         Me.GroupBox2.ResumeLayout(False)
  300.         Me.GroupBox3.ResumeLayout(False)
  301.         Me.ResumeLayout(False)
  302.  
  303.     End Sub
  304.  
  305. #End Region
  306.  
  307.     Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  308.         ora = (TimeOfDay)
  309.         Dim a As Integer
  310.         For a = 1 To 12000
  311.             TextBox1.Text = TextBox1.Text & Rnd()
  312.             ProgressBar1.Value = ProgressBar1.Value + 1
  313.         Next a
  314.         Label2.Text = ora
  315.         Label4.Text = (TimeOfDay)
  316.         ProgressBar1.Value = 0
  317.         Button2.Enabled = True
  318.         Button1.Enabled = False
  319.     End Sub
  320.  
  321.     Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
  322.         ora = (TimeOfDay)
  323.         Dim a As Integer
  324.         For a = 1 To 12000
  325.             TextBox1.Text = TextBox1.Text & Rnd()
  326.             ProgressBar1.Value = ProgressBar1.Value + 1
  327.         Next a
  328.         Label7.Text = ora
  329.         Label5.Text = (TimeOfDay)
  330.         ProgressBar1.Value = 0
  331.         Button3.Enabled = True
  332.         Button1.Enabled = False
  333.         Button2.Enabled = False
  334.     End Sub
  335.  
  336.     Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
  337.         ora = (TimeOfDay)
  338.         Dim a As Integer
  339.         For a = 1 To 12000
  340.             TextBox1.Text = TextBox1.Text & Rnd()
  341.             ProgressBar1.Value = ProgressBar1.Value + 1
  342.         Next a
  343.         Label11.Text = ora
  344.         Label9.Text = (TimeOfDay)
  345.         ProgressBar1.Value = 0
  346.         Button1.Enabled = False
  347.         Button2.Enabled = False
  348.         Button3.Enabled = False
  349.     End Sub
  350.  
  351.     Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
  352.         Dim form2 As New Form2
  353.         form2.ShowDialog()
  354.     End Sub
  355. End Class
  356.  
  357. Public Class Main
  358.     Shared Sub Main()
  359.         Application.EnableVisualStyles()
  360.         Application.Run(New Form1)
  361.     End Sub
  362. End Class