WPF VB VisualStudio

Hallo jungs,hab folgendes problem,hab nen source code den ich zum laufen bringen möchte bekomme aber mehrere fehler die ich nicht verstehe ,
es sind fehler solcher natur:
Fehler 3 Die Application-Klasse kann nicht von sich selbst erben:
"Application" erbt von "Application".
Fehler 4 "StartupUri" ist kein Member von "Bruteforce.Bruteforce.Application".
Fehler 5 "Run" ist kein Member von "Bruteforce.Bruteforce.Application".
Fehler 6 "LoadComponent" ist kein Member von "Bruteforce.Bruteforce.Application"

also insgesamt 24 fehler von ist kein member usw........und wieso Bruteforce.Bruteforce.Application? und nicht Bruteforce.Application?

wäre für jede hilfe dankbar:wink:
 
Schon mal daran gedacht den Code zu posten?
Vorzugsweise in Code-Tags und inklusive Spoiler:
Code:
oder auch nicht

mfg benediktibk
 
tjo ... meine kristallkugel ist frisch aus der reparatur ...

deine imports sind kaputt und ggf. fehlen dir referenzierte assemblies

namentlich mindestens System.Windows (für System.Windows.Application) aus dem assembly PresentationFramework.dll
 
Grüß gott,

danke für die antworten,also hier ist ein teil des codes:

Imports Microsoft.VisualBasic.ApplicationServices
Imports System
Imports System.CodeDom.Compiler
Imports System.Diagnostics
Imports System.Reflection
Imports System.Windows
Imports System.Windows.Threading

Namespace Bruteforce
<GeneratedCode("PresentationBuildTasks", "4.0.0.0")>
Public Class Application
Inherits System.Windows.Application


Friend ReadOnly Property Info() As AssemblyInfo
<System.Diagnostics.DebuggerHidden()>
Get
Return New AssemblyInfo(System.Reflection.Assembly.GetExecutingAssembly())
End Get
End Property

Public Sub New()
MyBase.DispatcherUnhandledException += New DispatcherUnhandledExceptionEventHandler(Me.Application_DispatcherUnhandledException)
End Sub

Private Sub Application_DispatcherUnhandledException(ByVal sender As Object, ByVal e As DispatcherUnhandledExceptionEventArgs)
MessageBox.Show(e.Exception.ToString(), "Error", MessageBoxButton.OK, MessageBoxImage.Hand)
e.Handled = True
End Sub

<System.Diagnostics.DebuggerNonUserCode()>
Public Sub InitializeComponent()
Me.StartupUri = New Uri("MainWindow.xaml", UriKind.Relative)
End Sub

<System.Diagnostics.DebuggerNonUserCode(), System.STAThread()>
Public Shared Sub Main()
Dim application As Application = New Application()
application.InitializeComponent()
application.Run()
End Sub
End Class
End Namespace

darauf gibt er zwei fehler:

Fehler 4 "Public Event DispatcherUnhandledException(sender As Object, e As System.Windows.Threading.DispatcherUnhandledExceptionEventArgs)" ist ein Ereignis und kann nicht direkt aufgerufen werden. Verwenden Sie eine RaiseEvent-Anweisung, um ein Ereignis aufzurufen.

Fehler 5 Der Delegat "System.Windows.Threading.DispatcherUnhandledExceptionEventHandler" erfordert als einziges Argument für seinen Konstruktor einen AddressOf-Ausdruck oder einen Lambda-Ausdruck.


Imports Microsoft.VisualBasic
Imports Microsoft.VisualBasic.CompilerServices
Imports System
Imports System.CodeDom.Compiler
Imports System.Collections
Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.Diagnostics
Imports System.Runtime.CompilerServices
Imports System.Timers
Imports System.Windows
Imports System.Windows.Controls
Imports System.Windows.Controls.DataVisualization.Charting
Imports System.Windows.Markup
Imports System.Windows.Threading

Namespace Bruteforce
<DesignerGenerated(), GeneratedCode("PresentationBuildTasks", "4.0.0.0")> _
Public Class MainWindow
Inherits System.Windows.Window

Implements System.Windows.Markup.IComponentConnector

' Methods
Public Sub New()
Me.InitializeComponent()
End Sub

Private Sub AddThread(ByVal threadType As String)
If (Me.timr Is Nothing) Then
Me.timr = New Timer
Me.timr.Interval = 5000
Me.timr.Enabled = True
End If
Me.threadCount += 1
Dim newItem As New TabItem With { _
.Header = ("Thread: " & Me.threadCount.ToString) _
}
Dim control As New TrybruteControl With { _
.ivpad = Me.txtIVPad2.Text, _
.payload1 = Me.txtTrybrutePayload1.Text, _
.payload2 = Me.txtTrybrutePayload2.Text _
}
If (threadType = "Random") Then
control.startbrute = String.Empty
Else
control.startbrute = threadType
End If
AddHandler control.SuccessfullyFinished, New SuccessfullyFinishedEventHandler(AddressOf Me.SuccessfullyFinished)
newItem.Content = control
Dim num As Integer = Me.tbControl.Items.Add(newItem)
Me.tbControl.SelectedIndex = num
If (Me.threadCount = &H10) Then
Me.btnAddThread.IsEnabled = False
End If
End Sub

Private Sub btnAddRandomThread_Click(ByVal sender As Object, ByVal e As RoutedEventArgs)
Me.AddThread("Random")
End Sub

Private Sub btnAddThread_Click(ByVal sender As Object, ByVal e As RoutedEventArgs)
Me.AddThread(Me.txtStartbrute.Text)
End Sub

Private Sub IncrementCounter()
Dim enumerator As IEnumerator
Dim expression As Long = 0
Dim num5 As Long = 0
Dim num4 As Long = 0
Dim num As Long = 0
Dim num2 As Integer = 0
Dim list As New List(Of ChartData)
Try
enumerator = DirectCast(Me.tbControl.Items, IEnumerable).GetEnumerator
Do While enumerator.MoveNext
Dim current As TabItem = DirectCast(enumerator.Current, TabItem)
If TypeOf current.Content Is TrybruteControl Then
Dim content As TrybruteControl = DirectCast(current.Content, TrybruteControl)
num2 += 1
expression = (expression + content.Progess.tries)
If (DateTime.Compare(content.Progess.started, DateTime.MinValue) <> 0) Then
Dim span As TimeSpan = DateTime.Now.Subtract(content.Progess.started)
num5 = CLng(Math.Round(CDbl((CDbl(content.Progess.tries) / span.TotalSeconds))))
End If
num4 = (num4 + num5)
num = (num + content.Progess.halves.Count)
Dim item As New ChartData With { _
.val = content.Progess.tries, _
.description = ("Thread " & num2.ToString) _
}
list.Add(item)
End If
Loop
Finally
If TypeOf enumerator Is IDisposable Then
TryCast(enumerator, IDisposable).Dispose()
End If
End Try
Me.txtTotal.Text = ("Total: " & Strings.Format(expression, "N0"))
Me.txtTriesPerSecond.Text = ("Tries per sec: " & Strings.Format(num4, "N0"))
Me.txtMisses.Text = ("Misses: " & Conversions.ToString(num))
Dim series As ColumnSeries = DirectCast(Me.myChart.Series.Item(0), ColumnSeries)
series.ItemsSource = list
Me.myChart.DataContext = series
End Sub

<DebuggerNonUserCode()> _
Public Sub InitializeComponent() Implements IComponentConnector.InitializeComponent
If Not Me._contentLoaded Then
Me._contentLoaded = True
Dim resourceLocator As New Uri("/Bruteforce;component/mainwindow.xaml", UriKind.Relative)
Application.LoadComponent(Me, resourceLocator)
End If
End Sub

Protected Sub SuccessfullyFinished()
MessageBox.Show("A thread has successfully completed!!!")
End Sub

<DebuggerNonUserCode(), EditorBrowsable(EditorBrowsableState.Never)> _
Public Sub System_Windows_Markup_IComponentConnector_Connect(ByVal connectionId As Integer, ByVal target As Object) Implements IComponentConnector.Connect
If (connectionId = 1) Then
Me.tbControl = DirectCast(target, TabControl)
ElseIf (connectionId = 2) Then
Me.txtIVPad2 = DirectCast(target, TextBox)
ElseIf (connectionId = 3) Then
Me.txtTrybrutePayload1 = DirectCast(target, TextBox)
ElseIf (connectionId = 4) Then
Me.txtTrybrutePayload2 = DirectCast(target, TextBox)
ElseIf (connectionId = 5) Then
Me.btnAddThread = DirectCast(target, Button)
AddHandler Me.btnAddThread.Click, New RoutedEventHandler(AddressOf Me.btnAddThread_Click)
ElseIf (connectionId = 6) Then
Me.btnAddRandomThread = DirectCast(target, Button)
AddHandler Me.btnAddRandomThread.Click, New RoutedEventHandler(AddressOf Me.btnAddRandomThread_Click)
ElseIf (connectionId = 7) Then
Me.txtStartbrute = DirectCast(target, TextBox)
ElseIf (connectionId = 8) Then
Me.txtTotal = DirectCast(target, TextBlock)
ElseIf (connectionId = 9) Then
Me.txtTriesPerSecond = DirectCast(target, TextBlock)
ElseIf (connectionId = 10) Then
Me.txtMisses = DirectCast(target, TextBlock)
ElseIf (connectionId = 11) Then
Me.myChart = DirectCast(target, Chart)
Else
Me._contentLoaded = True
End If
End Sub

Private Sub timr_Tick(ByVal sender As Object, ByVal e As ElapsedEventArgs)
Me.MyDispatcher.BeginInvoke(New UpdateUIDelegate(AddressOf Me.IncrementCounter), New Object(0 - 1) {})
End Sub


' Properties
Friend Overridable Property btnAddRandomThread As Button
Get
Return Me._btnAddRandomThread
End Get
<MethodImpl(MethodImplOptions.Synchronized)> _
Set(ByVal WithEventsValue As Button)
Me._btnAddRandomThread = WithEventsValue
End Set
End Property

Friend Overridable Property btnAddThread As Button
Get
Return Me._btnAddThread
End Get
<MethodImpl(MethodImplOptions.Synchronized)> _
Set(ByVal WithEventsValue As Button)
Me._btnAddThread = WithEventsValue
End Set
End Property

Friend Overridable Property myChart As Chart
Get
Return Me._myChart
End Get
<MethodImpl(MethodImplOptions.Synchronized)> _
Set(ByVal WithEventsValue As Chart)
Me._myChart = WithEventsValue
End Set
End Property

Friend Overridable Property tbControl As TabControl
Get
Return Me._tbControl
End Get
<MethodImpl(MethodImplOptions.Synchronized)> _
Set(ByVal WithEventsValue As TabControl)
Me._tbControl = WithEventsValue
End Set
End Property

Private Overridable Property timr As Timer
Get
Return Me._timr
End Get
<MethodImpl(MethodImplOptions.Synchronized)> _
Set(ByVal WithEventsValue As Timer)
Dim handler As ElapsedEventHandler = New ElapsedEventHandler(AddressOf Me.timr_Tick)
If (Not Me._timr Is Nothing) Then
RemoveHandler Me._timr.Elapsed, handler
End If
Me._timr = WithEventsValue
If (Not Me._timr Is Nothing) Then
AddHandler Me._timr.Elapsed, handler
End If
End Set
End Property

Friend Overridable Property txtIVPad2 As TextBox
Get
Return Me._txtIVPad2
End Get
<MethodImpl(MethodImplOptions.Synchronized)> _
Set(ByVal WithEventsValue As TextBox)
Me._txtIVPad2 = WithEventsValue
End Set
End Property

Friend Overridable Property txtMisses As TextBlock
Get
Return Me._txtMisses
End Get
<MethodImpl(MethodImplOptions.Synchronized)> _
Set(ByVal WithEventsValue As TextBlock)
Me._txtMisses = WithEventsValue
End Set
End Property

Friend Overridable Property txtStartbrute As TextBox
Get
Return Me._txtStartbrute
End Get
<MethodImpl(MethodImplOptions.Synchronized)> _
Set(ByVal WithEventsValue As TextBox)
Me._txtStartbrute = WithEventsValue
End Set
End Property

Friend Overridable Property txtTotal As TextBlock
Get
Return Me._txtTotal
End Get
<MethodImpl(MethodImplOptions.Synchronized)> _
Set(ByVal WithEventsValue As TextBlock)
Me._txtTotal = WithEventsValue
End Set
End Property

Friend Overridable Property txtTriesPerSecond As TextBlock
Get
Return Me._txtTriesPerSecond
End Get
<MethodImpl(MethodImplOptions.Synchronized)> _
Set(ByVal WithEventsValue As TextBlock)
Me._txtTriesPerSecond = WithEventsValue
End Set
End Property

Friend Overridable Property txtTryAxiPayload1 As TextBox
Get
Return Me._txtTrybrutePayload1
End Get
<MethodImpl(MethodImplOptions.Synchronized)> _
Set(ByVal WithEventsValue As TextBox)
Me._txtTrybrutePayload1 = WithEventsValue
End Set
End Property

Friend Overridable Property txtTrybrutePayload2 As TextBox
Get
Return Me._txtTrybrutePayload2
End Get
<MethodImpl(MethodImplOptions.Synchronized)> _
Set(ByVal WithEventsValue As TextBox)
Me._txtTrybrutePayload2 = WithEventsValue
End Set
End Property


' Fields
<AccessedThroughProperty("btnAddRandomThread")> _
Private _btnAddRandomThread As Button
<AccessedThroughProperty("btnAddThread")> _
Private _btnAddThread As Button
Private _contentLoaded As Boolean
<AccessedThroughProperty("myChart")> _
Private _myChart As Chart
<AccessedThroughProperty("tbControl")> _
Private _tbControl As TabControl
<AccessedThroughProperty("timr")> _
Private _timr As Timer
<AccessedThroughProperty("txtIVPad2")> _
Private _txtIVPad2 As TextBox
<AccessedThroughProperty("txtMisses")> _
Private _txtMisses As TextBlock
<AccessedThroughProperty("txtStartbrute")> _
Private _txtStartbrute As TextBox
<AccessedThroughProperty("txtTotal")> _
Private _txtTotal As TextBlock
<AccessedThroughProperty("txtTriesPerSecond")> _
Private _txtTriesPerSecond As TextBlock
<AccessedThroughProperty("txtTrybrutePayload1")> _
Private _txtTrybrutePayload1 As TextBox
<AccessedThroughProperty("txtTrybrutePayload2")> _
Private _txtTrybrutePayload2 As TextBox
Private MyDispatcher As Dispatcher = Dispatcher.CurrentDispatcher
Private threadCount As Integer = 0

' Nested Types
Private Delegate Sub UpdateUIDelegate()
End Class
End Namespace

die fehler:

Der Typ "SuccessfullyFinishedEventHandler" ist nicht definiert.

Die enumerator-Variable wird verwendet, bevor ihr ein Wert zugewiesen wird. Zur Laufzeit kann eine Nullverweisausnahme auftreten.

"Private" und "Overridable" können nicht kombiniert werden.



in der mainwindow.xaml gibt er zwei fehler dieser natur obwohl die tripledes.vb vorhanden ist
<TextBlock Text="Test 3Des algos" Margin="2,0,0,0" VerticalAlignment="Center" />
</TabItem.Header>
<dcc:TripleDesTestControl />




Der dcc:TripleDesTestControl-Typ wurde nicht gefunden. Alle Assemblyverweise müssen vorhanden sein, und alle Assemblys, auf die verwiesen wird, müssen erstellt worden sein.
 
Zuletzt bearbeitet:
Code:
            MyBase.DispatcherUnhandledException += New DispatcherUnhandledExceptionEventHandler(Me.Application_DispatcherUnhandledException)
bist du sicher, dass du dich mit der sprache auseinandergesetzt hast, und nicht nur copy-pasta vor dir hast? das ist ein c# call zum anhängen eines event handlers ... vb hätte gerne einen "addHandler"-aufruf
Code:
            Dim enumerator As IEnumerator
ändern zu
Code:
            Dim enumerator As IEnumerator = Nothing
Code:
        Private Overridable Property timr As Timer
... mach aus dem "Private" mal ein "Friend"...

dein event handler typ ist in dem von dir gezeigten code nicht definiert vermutlich wird dir das Trybrutecontrol weiterhelfen ... da steht die definition des events ... evtl auch die definition des eventhandlertyps

in der mainwindow.xaml gibt er zwei fehler dieser natur obwohl die tripledes.vb vorhanden ist
<TextBlock Text="Test 3Des algos" Margin="2,0,0,0" VerticalAlignment="Center" />
</TabItem.Header>
<dcc:TripleDesTestControl />

Der dcc:TripleDesTestControl-Typ wurde nicht gefunden. Alle Assemblyverweise müssen vorhanden sein, und alle Assemblys, auf die verwiesen wird, müssen erstellt worden sein.
es fehlt vermutlich die namespace definition für dcc im <Window> tag ...xmlns...
 
Danke für die hilfe werd ich gleich mal ausprobieren.

Also der VB sprache bin ich natürlich nicht mächtig,versuche mir gerade c++ beizubringen.

der code kommt von reflector daher denke ich auch kommen diese fehler,möchte eigentlich nur was in den code verändern deswegen das ganze.



mfg
 
so hab jetzt alle fehler beseitigt außer einen und eine warnung und zwar:

Fehler 1 "Sub Main" wird in "Bruteforce" mehrmals deklariert: Bruteforce.Application.Main(), Bruteforce.Brutforce.Application.Main()


Warnung 2 Die enumerator-Variable wird verwendet, bevor ihr ein Wert zugewiesen wird. Zur Laufzeit kann eine Nullverweisausnahme auftreten.

ich hab zu fehler 1 sub main nur einmal gebraucht ich hab alle dateien durchsucht oder ist da was anderes mit gemeint?
 
Zurück
Oben