Anpassungen Variablen/Logik
This commit is contained in:
@@ -9,32 +9,41 @@ Partial Class Customers_Default2
|
||||
|
||||
If Page.IsPostBack Then
|
||||
Page.MaintainScrollPositionOnPostBack = True
|
||||
|
||||
If Not HttpContext.Current.Request.ServerVariables("SERVER_NAME") = "localhost" Then
|
||||
btn_TesthashrateServer.Text = "Test hashrate of the Server!"
|
||||
Else
|
||||
btn_TesthashrateServer.Text = "Test hashrate of the local machine!"
|
||||
End If
|
||||
VERAG_VARIABLES.initerrorcount()
|
||||
If Integer.Parse(sld_getbenchmarkheat.Value) < 10 Then
|
||||
MemorySizelocal = (((nIterations * 1) * 4.68 - ((nIterations * 2) * 1.23) / 4 * 1.5) / 1.05) + 0.75 * 254
|
||||
MemorySizeProductionServ = (((nIterations * VERAG_VARIABLES.RandomInteger(1, 2)) * 7.485 - ((nIterations * VERAG_VARIABLES.RandomInteger(1, 2)) * 0.56) / 1.85 * 2.28) / 8.28) + 1.024 * 400
|
||||
randzahl = VERAG_VARIABLES.RandomInteger(VERAG_VARIABLES.RandomInteger(Math.Pow(2, 0), Math.Pow(2, 1)), Math.Pow(2, 2))
|
||||
MemorySizelocal = (((nIterations * 1) * 4.28 - ((nIterations * 2) * 1.23) / 4 * 1.5) / 1.05) + 0.75 * 354
|
||||
MemorySizeProductionServ = (((nIterations * VERAG_VARIABLES.RandomInteger(1, 2)) * 5.485 - ((nIterations * VERAG_VARIABLES.RandomInteger(1, 2)) * 0.56) / 1.85 * 2.28) / 8.28) + 1.024 * 400
|
||||
randzahl = VERAG_VARIABLES.RandomInteger(Math.Pow(2, 2), Math.Pow(2, 4))
|
||||
ElseIf Integer.Parse(sld_getbenchmarkheat.Value) > 10 And Integer.Parse(sld_getbenchmarkheat.Value) < 40 Then
|
||||
MemorySizelocal = (((nIterations * 2) * 4.68 - ((nIterations * 2) * 1.23) / 4 * 1.5) / 1.05) + 0.75 * 290
|
||||
MemorySizeProductionServ = (((nIterations * VERAG_VARIABLES.RandomInteger(1, 2)) * 7.485 - ((nIterations * VERAG_VARIABLES.RandomInteger(1, 2)) * 0.56) / 1.85 * 2.28) / 8.28) + 1.024 * 416
|
||||
MemorySizelocal = (((nIterations * 1.255) * 4.48 - ((nIterations * 1.12) * 1.23) / 4 * 1.5) / 1.05) + 0.75 * 390
|
||||
MemorySizeProductionServ = (((nIterations * VERAG_VARIABLES.RandomInteger(1, 2.5)) * 6.485 - ((nIterations * VERAG_VARIABLES.RandomInteger(1, 2)) * 0.56) / 1.85 * 2.28) / 8.28) + 1.024 * 516
|
||||
randzahl = VERAG_VARIABLES.RandomInteger(VERAG_VARIABLES.RandomInteger(Math.Pow(2, 0), Math.Pow(2, 2)), Math.Pow(2, 4))
|
||||
ElseIf Integer.Parse(sld_getbenchmarkheat.Value) > 40 And Integer.Parse(sld_getbenchmarkheat.Value) < 60 Then
|
||||
MemorySizelocal = (((nIterations * 2.45) * 4.98 - ((nIterations * 1.15) * 1.23) / 4 * 1.5) / 1.05) + 0.95 * 290
|
||||
MemorySizeProductionServ = (((nIterations * VERAG_VARIABLES.RandomInteger(1, 2.32)) * 7.485 - ((nIterations * VERAG_VARIABLES.RandomInteger(1, 2.32)) * 0.56) / 1.85 * 2.28) / 7.28) + 1.024 * 416
|
||||
MemorySizelocal = (((nIterations * 1.45) * 4.98 - ((nIterations * 1.15) * 1.23) / 4 * 1.5) / 1.05) + 0.95 * 420
|
||||
MemorySizeProductionServ = (((nIterations * VERAG_VARIABLES.RandomInteger(1, 2.32)) * 7.485 - ((nIterations * VERAG_VARIABLES.RandomInteger(1, 2.32)) * 0.56) / 1.85 * 2.28) / 7.28) + 1.024 * 646
|
||||
randzahl = VERAG_VARIABLES.RandomInteger(VERAG_VARIABLES.RandomInteger(Math.Pow(2, 0), Math.Pow(2, 4)), VERAG_VARIABLES.RandomInteger(Math.Pow(2, 3), Math.Pow(2, 4)))
|
||||
ElseIf Integer.Parse(sld_getbenchmarkheat.Value) > 60 And Integer.Parse(sld_getbenchmarkheat.Value) < 80 Then
|
||||
MemorySizelocal = (((nIterations * 2.45) * 4.98 - ((nIterations * 2) * 1.23) / 4 * 1.5) / 1.05) + 1 * 290
|
||||
MemorySizeProductionServ = (((nIterations * VERAG_VARIABLES.RandomInteger(1, 2.32)) * 8.585 - ((nIterations * VERAG_VARIABLES.RandomInteger(1, 2.32)) * 0.56) / 1.85 * 2.28) / 7.28) + 1.024 * 416
|
||||
MemorySizelocal = (((nIterations * 1.85) * 4.98 - ((nIterations * 2) * 1.23) / 4 * 1.5) / 1.05) + 1 * 790
|
||||
MemorySizeProductionServ = (((nIterations * VERAG_VARIABLES.RandomInteger(1, 2.32)) * 8.585 - ((nIterations * VERAG_VARIABLES.RandomInteger(1, 2.32)) * 0.56) / 1.85 * 2.28) / 7.28) + 1.024 * 816
|
||||
randzahl = VERAG_VARIABLES.RandomInteger(VERAG_VARIABLES.RandomInteger(Math.Pow(2, 4), Math.Pow(2, 5)), VERAG_VARIABLES.RandomInteger(Math.Pow(2, 5), Math.Pow(2, 7)))
|
||||
ElseIf Integer.Parse(sld_getbenchmarkheat.Value) > 80 And Integer.Parse(sld_getbenchmarkheat.Value) < 100 Then
|
||||
MemorySizelocal = (((nIterations * 2) * 4.98 - ((nIterations * 2) * 1.23) / 4 * 1.5) / 1.05) + 1 * 290
|
||||
MemorySizeProductionServ = (((nIterations * VERAG_VARIABLES.RandomInteger(1, 3)) * 9.485 - ((nIterations * VERAG_VARIABLES.RandomInteger(1, 3)) * 0.56) / 1.85 * 2.28) / 8.28) + 1.024 * 416
|
||||
randzahl = VERAG_VARIABLES.RandomInteger(VERAG_VARIABLES.RandomInteger(Math.Pow(2, 5), Math.Pow(2, 6)), VERAG_VARIABLES.RandomInteger(Math.Pow(2, 6), Math.Pow(2, 7)))
|
||||
randzahl = VERAG_VARIABLES.RandomInteger(VERAG_VARIABLES.RandomInteger(Math.Pow(2, 3), Math.Pow(2, 4)), VERAG_VARIABLES.RandomInteger(Math.Pow(2, 5), Math.Pow(2, 7)))
|
||||
End If
|
||||
Else
|
||||
Page.MaintainScrollPositionOnPostBack = False
|
||||
VERAG_VARIABLES.initerrorcount()
|
||||
If Not HttpContext.Current.Request.ServerVariables("SERVER_NAME") = "localhost" Then
|
||||
btn_TesthashrateServer.Text = "Test hashrate of the Server!"
|
||||
Else
|
||||
btn_TesthashrateServer.Text = "Test hashrate of the local machine!"
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
@@ -61,25 +70,25 @@ Partial Class Customers_Default2
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub btn_TesthashrateServer_ClickAsync(sender As Object, e As EventArgs) Handles btn_TesthashrateServer.Click
|
||||
Protected Async Sub btn_TesthashrateServer_ClickAsync(sender As Object, e As EventArgs) Handles btn_TesthashrateServer.Click
|
||||
Dim Boole As Boolean = New Boolean
|
||||
Dim ram As Double = Double.Parse(My.Computer.Info.TotalPhysicalMemory.ToString)
|
||||
Dim pwhashresult As Byte()
|
||||
If MemorySizelocal < ram And HttpContext.Current.Request.ServerVariables("SERVER_NAME") = "localhost" Then
|
||||
pwhashresult = TestPerformance.TestHashrateServer(randzahl)
|
||||
Dim pwhashresult As String
|
||||
If MemorySizelocal <= ram - (10 * 1024) And HttpContext.Current.Request.ServerVariables("SERVER_NAME") = "localhost" Then
|
||||
pwhashresult = Await TestPerformance.TestHashrateServerAsync(randzahl)
|
||||
Boole = True
|
||||
ElseIf MemorySizeProductionServ < ram And Not HttpContext.Current.Request.ServerVariables("SERVER_NAME") = "localhost" Then
|
||||
pwhashresult = TestPerformance.TestHashrateServer(randzahl)
|
||||
ElseIf MemorySizeProductionServ <= ram - 2048 And Not HttpContext.Current.Request.ServerVariables("SERVER_NAME") = "localhost" Then
|
||||
pwhashresult = Await TestPerformance.TestHashrateServerAsync(randzahl)
|
||||
Boole = True
|
||||
Else
|
||||
Boole = False
|
||||
End If
|
||||
If Boole = True AndAlso HttpContext.Current.Request.ServerVariables("SERVER_NAME") = "localhost" Then
|
||||
lbl_Status.ForeColor = Drawing.Color.Green
|
||||
lbl_Status.Text = "Der Test wurde erfolgreich bestanden! Der Salt lautet:" + Convert.ToBase64String(pwhashresult) + System.Environment.NewLine + "der Ram betrug:" + MemorySizelocal.ToString
|
||||
lbl_Status.Text = "Der Test wurde erfolgreich bestanden!" + System.Environment.NewLine + "Der Hash lautet:" + pwhashresult + System.Environment.NewLine + "der Ram betrug:" + MemorySizelocal.ToString
|
||||
ElseIf Boole = True AndAlso Not HttpContext.Current.Request.ServerVariables("SERVER_NAME") = "localhost" Then
|
||||
lbl_Status.ForeColor = Drawing.Color.Green
|
||||
lbl_Status.Text = "Der Test wurde erfolgreich bestanden! Der Hash lautet:" + Convert.ToBase64String(pwhashresult) + System.Environment.NewLine + "der Ram betrug:" + MemorySizeProductionServ.ToString
|
||||
lbl_Status.Text = "Der Test wurde erfolgreich bestanden!" + System.Environment.NewLine + "Der Hash lautet:" + pwhashresult + System.Environment.NewLine + "der Ram betrug:" + MemorySizeProductionServ.ToString
|
||||
ElseIf Boole = False AndAlso HttpContext.Current.Request.ServerVariables("SERVER_NAME") = "localhost" Then
|
||||
lbl_Status.ForeColor = Drawing.Color.Red
|
||||
lbl_Status.Text = "Test fehlgeschlagen! Es fehlen mindestens " + MemorySizelocal - ram + "Bytes RAM!"
|
||||
|
||||
Reference in New Issue
Block a user