Revert "Änderungen"

This reverts commit 94c7c5fd99.
This commit is contained in:
ja
2021-12-15 11:44:33 +01:00
parent 94c7c5fd99
commit cb7be47bb2
5 changed files with 106 additions and 168 deletions

View File

@@ -1,10 +1,8 @@
Imports System.Data.SqlClient
Imports System.Diagnostics
Imports Microsoft.VisualBasic
Public Class TestPerformance
Public Shared zeitspannefürtest As Long
Public Shared Sub createnUsers(ByRef n As Integer)
Dim ConnectionString = ""
@@ -111,54 +109,5 @@ Public Class TestPerformance
End Using
End Sub
Public Shared Sub DeleteUsers()
End Sub
Public Shared Async Function TestSaltHashRateMax(z As Integer) As Threading.Tasks.Task(Of Byte())
Dim timespan As Long = New Long()
Dim timespan2 As Long = New Long()
Dim Bytearr As List(Of Byte()) = New List(Of Byte())
Dim pwarr As List(Of Byte()) = New List(Of Byte())
Dim pwselectedindex As Integer = -1
For ztemp As Integer = 0 To z
Bytearr.Add(VERAG_VARIABLES.GenerateSalt(z))
Next
For ztemp As Integer = 0 To z
Dim timer1 As Stopwatch = New Stopwatch
timer1.Start()
If timer1.IsRunning = True Then
Bytearr.Add(VERAG_VARIABLES.GenerateSalt(z))
Dim iteras As Integer = VERAG_VARIABLES.getiterationnumber()
Dim intz As Integer = VERAG_VARIABLES.RandomInteger(0, z)
Dim Passw As String = "XFV2ctdhB5G*S!r"
pwarr.Add(Await VERAG_VARIABLES.HashPassword(Passw, Bytearr.Item(z), iteras, intz))
End If
timer1.Stop()
timespan = timer1.ElapsedMilliseconds
Dim timer2 As Stopwatch = New Stopwatch
timer2.Start()
If timer2.IsRunning = True Then
Bytearr.Add(VERAG_VARIABLES.GenerateSalt(z))
Dim iteras As Integer = VERAG_VARIABLES.getiterationnumber()
Dim intz As Integer = VERAG_VARIABLES.RandomInteger(0, z)
Dim Passw As String = "XFV2ctdhB5G*S!r"
pwarr.Add(Await VERAG_VARIABLES.HashPassword(Passw, Bytearr.Item(z), iteras, intz))
End If
timer2.Stop()
timespan2 = timer2.ElapsedMilliseconds
If timespan2 < timespan Then
pwselectedindex = z
zeitspannefürtest = timespan2
ElseIf timespan < timespan2 Then
pwselectedindex = z
zeitspannefürtest = timespan
End If
Next
If Not pwselectedindex = -1 Then
Return Bytearr(pwselectedindex)
End If
End Function
Public Shared DeleteUsers()
End Class

View File

@@ -1,4 +1,4 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Customers/Customers.master" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="Customers_Default" Async="true" %>
<%@ Page Title="" Language="VB" MasterPageFile="~/Customers/Customers.master" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="Customers_Default" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder2" Runat="Server">
</asp:Content>

View File

@@ -1,4 +1,4 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Customers/Customers.master" AutoEventWireup="false" CodeFile="Default2.aspx.vb" Inherits="Customers_Default2" Async="true" %>
<%@ Page Title="" Language="VB" MasterPageFile="~/Customers/Customers.master" AutoEventWireup="false" CodeFile="Default2.aspx.vb" Inherits="Customers_Default2" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder2" Runat="Server"><%If String.Equals(Page.User.Identity.Name, "Admin") = False Then
FormsAuthentication.RedirectToLoginPage()
@@ -79,8 +79,6 @@
</tr>
<tr><td>
<tr><td><asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" /></td></tr>
<tr><td><asp:Button ID="Butn_TestHashrate" runat="server" OnClick="Butn_TestHashrate_ClickAsync" BackColor="WhiteSmoke" Text="Test the Hashrate of the Server"/></td></tr>
<tr><td><asp:Label ID="lbl_resulttesthashrate" runat="server" ClientIDMode="AutoID">Hier wird das Ergebnis angezeigt!</asp:Label></td></tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>

View File

@@ -1,7 +1,7 @@

Partial Class Customers_Default2
Inherits System.Web.UI.Page
Protected Async Sub Page_Load(ByVal sender As Object, e As EventArgs) Handles Me.Load
Protected Sub Page_Load(ByVal sender As Object, e As EventArgs) Handles Me.Load
If Page.IsPostBack Then
Page.MaintainScrollPositionOnPostBack = True
@@ -33,12 +33,4 @@ Partial Class Customers_Default2
txt_Fehlercodezuzahl.Text = finalstr
End If
End Sub
Protected Async Function Butn_TestHashrate_ClickAsync(sender As Object, e As EventArgs) As Threading.Tasks.Task
Dim ztemp As Byte() = Await TestPerformance.TestSaltHashRateMax(VERAG_VARIABLES.RandomInteger(Math.Pow(2, 10), Math.Pow(2, 14)))
lbl_resulttesthashrate.ForeColor = Drawing.Color.GreenYellow
lbl_resulttesthashrate.Text = "Successful Test with: " + Convert.ToBase64String(ztemp) + "in der zeit: " + Space(2) + TimeSpan.FromMilliseconds(TestPerformance.zeitspannefürtest).Milliseconds.ToString
End Function
End Class

View File

@@ -6,8 +6,7 @@
<head>
<%@ import Namespace="MySql.Data.MySqlClient" %>
<script runat="server">
Overloads Sub Page_Load() Handles Me.Load
Sub Page_Load() Handles Me.Load
' MsgBox ("test")
'Dim con As New MySqlConnection
'Dim cmd As New MySqlCommand