Résolu Erreur System.InvalidOperationException dans mon application

TrZ'

Riyal Qatarien
Premium
Inscription
17 Mars 2013
Messages
1 258
Réactions
509
Points
7 815
RGCoins
25
Bonjour à tous !
Alors voila, j'ai cette foutu erreur qui me gave:
67814e8327c74bb6bd97c11f2581a650.png


J'ai beau faire des recherches internet je ne trouve rien... Voici le message complet:


Une exception non gérée du type 'System.InvalidOperationException' s'est produite dans Management by Nicolas.exe

Informations supplémentaires : Une erreur s'est produite lors de la création du formulaire. Pour plus d'informations, consultez Exception.InnerException. L'erreur est : Impossible de trouver des ressources appropriées pour la culture spécifiée ou la culture neutre. Assurez-vous que "Management_by_Nicolas.page_connect.resources" a été correctement incorporé ou lié dans l'assembly "Management by Nicolas" au moment de la compilation ou que tous les assemblys satellites requis sont chargeables et complètement signés.
 
Sans code source on ne pourra pas t'aider.
Voila:

Code:
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()>
Partial Class page_connect
    Inherits System.Windows.Forms.Form

    'Form remplace la méthode Dispose pour nettoyer la liste des composants.
    <System.Diagnostics.DebuggerNonUserCode()> _
    Protected Overrides Sub Dispose(ByVal disposing As Boolean)
        Try
            If disposing AndAlso components IsNot Nothing Then
                components.Dispose()
            End If
        Finally
            MyBase.Dispose(disposing)
        End Try
    End Sub

    'Requise par le Concepteur Windows Form
    Private components As System.ComponentModel.IContainer

    'REMARQUE : la procédure suivante est requise par le Concepteur Windows Form
    'Elle peut être modifiée à l'aide du Concepteur Windows Form. 
    'Ne la modifiez pas à l'aide de l'éditeur de code.
    <System.Diagnostics.DebuggerStepThrough()> _
    Private Sub InitializeComponent()
        Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(page_connect))
        Me.page_theme = New Management_by_Nicolas.EarnTheme()
        Me.label_close = New System.Windows.Forms.Label()
        Me.button_buy = New Management_by_Nicolas.EarnButton()
        Me.button_connect = New Management_by_Nicolas.EarnButton()
        Me.textbox_password = New Management_by_Nicolas.EarnTextBox()
        Me.textbox_nom = New Management_by_Nicolas.EarnTextBox()
        Me.label_password = New System.Windows.Forms.Label()
        Me.label_nom = New System.Windows.Forms.Label()
        Me.label_connect = New System.Windows.Forms.Label()
        Me.page_theme.SuspendLayout()
        Me.SuspendLayout()
        '
        'page_theme
        '
        Me.page_theme.BackColor = System.Drawing.Color.FromArgb(CType(CType(240, Byte), Integer), CType(CType(240, Byte), Integer), CType(CType(240, Byte), Integer))
        Me.page_theme.BorderStyle = System.Windows.Forms.FormBorderStyle.None
        Me.page_theme.Controls.Add(Me.label_close)
        Me.page_theme.Controls.Add(Me.button_buy)
        Me.page_theme.Controls.Add(Me.button_connect)
        Me.page_theme.Controls.Add(Me.textbox_password)
        Me.page_theme.Controls.Add(Me.textbox_nom)
        Me.page_theme.Controls.Add(Me.label_password)
        Me.page_theme.Controls.Add(Me.label_nom)
        Me.page_theme.Controls.Add(Me.label_connect)
        Me.page_theme.Customization = "WU1L//////8="
        resources.ApplyResources(Me.page_theme, "page_theme")
        Me.page_theme.Image = Nothing
        Me.page_theme.Movable = True
        Me.page_theme.Name = "page_theme"
        Me.page_theme.NoRounding = False
        Me.page_theme.Sizable = False
        Me.page_theme.SmartBounds = True
        Me.page_theme.StartPosition = System.Windows.Forms.FormStartPosition.WindowsDefaultLocation
        Me.page_theme.TransparencyKey = System.Drawing.Color.Fuchsia
        Me.page_theme.Transparent = False
        '
        'label_close
        '
        resources.ApplyResources(Me.label_close, "label_close")
        Me.label_close.BackColor = System.Drawing.Color.Transparent
        Me.label_close.ForeColor = System.Drawing.Color.White
        Me.label_close.Name = "label_close"
        '
        'button_buy
        '
        Me.button_buy.Customization = "WU1L/4CAgP//////"
        resources.ApplyResources(Me.button_buy, "button_buy")
        Me.button_buy.Image = Nothing
        Me.button_buy.Name = "button_buy"
        Me.button_buy.NoRounding = False
        Me.button_buy.Transparent = False
        '
        'button_connect
        '
        Me.button_connect.Customization = "WU1L/4CAgP//////"
        resources.ApplyResources(Me.button_connect, "button_connect")
        Me.button_connect.Image = Nothing
        Me.button_connect.Name = "button_connect"
        Me.button_connect.NoRounding = False
        Me.button_connect.Transparent = False
        '
        'textbox_password
        '
        Me.textbox_password.Customization = "WU1L//Dw8P9ZTUv/"
        resources.ApplyResources(Me.textbox_password, "textbox_password")
        Me.textbox_password.Image = Nothing
        Me.textbox_password.MaxLength = 32767
        Me.textbox_password.Multiline = False
        Me.textbox_password.Name = "textbox_password"
        Me.textbox_password.NoRounding = False
        Me.textbox_password.ReadOnly = False
        Me.textbox_password.TextAlign = System.Windows.Forms.HorizontalAlignment.Left
        Me.textbox_password.Transparent = False
        Me.textbox_password.UseSystemPasswordChar = True
        '
        'textbox_nom
        '
        Me.textbox_nom.Customization = "WU1L//Dw8P9ZTUv/"
        resources.ApplyResources(Me.textbox_nom, "textbox_nom")
        Me.textbox_nom.Image = Nothing
        Me.textbox_nom.MaxLength = 32767
        Me.textbox_nom.Multiline = False
        Me.textbox_nom.Name = "textbox_nom"
        Me.textbox_nom.NoRounding = False
        Me.textbox_nom.ReadOnly = False
        Me.textbox_nom.TextAlign = System.Windows.Forms.HorizontalAlignment.Left
        Me.textbox_nom.Transparent = False
        Me.textbox_nom.UseSystemPasswordChar = False
        '
        'label_password
        '
        resources.ApplyResources(Me.label_password, "label_password")
        Me.label_password.ForeColor = System.Drawing.Color.FromArgb(CType(CType(75, Byte), Integer), CType(CType(77, Byte), Integer), CType(CType(89, Byte), Integer))
        Me.label_password.Name = "label_password"
        '
        'label_nom
        '
        resources.ApplyResources(Me.label_nom, "label_nom")
        Me.label_nom.ForeColor = System.Drawing.Color.FromArgb(CType(CType(75, Byte), Integer), CType(CType(77, Byte), Integer), CType(CType(89, Byte), Integer))
        Me.label_nom.Name = "label_nom"
        '
        'label_connect
        '
        Me.label_connect.AllowDrop = True
        resources.ApplyResources(Me.label_connect, "label_connect")
        Me.label_connect.ForeColor = System.Drawing.Color.FromArgb(CType(CType(75, Byte), Integer), CType(CType(77, Byte), Integer), CType(CType(89, Byte), Integer))
        Me.label_connect.Name = "label_connect"
        '
        'page_connect
        '
        resources.ApplyResources(Me, "$this")
        Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
        Me.Controls.Add(Me.page_theme)
        Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None
        Me.Name = "page_connect"
        Me.TransparencyKey = System.Drawing.Color.Fuchsia
        Me.page_theme.ResumeLayout(False)
        Me.page_theme.PerformLayout()
        Me.ResumeLayout(False)

    End Sub

    Friend WithEvents page_theme As EarnTheme
    Friend WithEvents label_connect As Label
    Friend WithEvents label_nom As Label
    Friend WithEvents textbox_password As EarnTextBox
    Friend WithEvents textbox_nom As EarnTextBox
    Friend WithEvents label_password As Label
    Friend WithEvents button_buy As EarnButton
    Friend WithEvents button_connect As EarnButton
    Friend WithEvents label_close As Label

    Private Sub label_close_Click(sender As Object, e As EventArgs) Handles label_close.Click
        End
    End Sub

    Private Sub label_minimize_Click(sender As Object, e As EventArgs)
        Me.WindowState = FormWindowState.Minimized
    End Sub

    Private Sub button_connect_Click(sender As Object, e As EventArgs) Handles button_connect.Click
        Dim Result As Integer

        If textbox_nom.Text = Nothing Or textbox_password.Text = Nothing Then
            ErrorMsg("Merci de remplir tout les champs !")
            Exit Sub
        End If
        Result = Connect(textbox_nom.Text, textbox_password.Text)
        If Result > 0 Then
            MessageBox.Show("Connexion réussie" & vbNewLine & If(Result = 2, "Vous êtes premium", "Vous n'êtes pas premium"), "Connexion réussie", MessageBoxButtons.OK, MessageBoxIcon.Information)
        End If
    End Sub

    Public Function Connect(User As String, Password As String)
        Dim Response As String
        Dim SessionID As String = RandomChar(10)

        Response = GetResponse(SessionID, "http://LESITE.fr/action.php?" & "action=connect" & "&sessionID=" & SessionID & "&user=" & User & "&password=" & Password)
        If Response = Nothing Then Return 0
        If CheckError(Response) = True Then Return 0
        If Not Response.StartsWith("OK") Then
            ErrorMsg("Erreur")
            Return 0
        End If
        Return If(Response.EndsWith("1"), 2, 1)
    End Function

End Class


' Me.WindowState = FormWindowState.Minimized // Pour Minimiser la fenetre

Code:
Module manager

    Dim ErrorMessages As Dictionary(Of String, String) = New Dictionary(Of String, String) From {
    {"ERROR_BDD_CONNECTION", "Erreur de connexion à la base de donnée"},
    {"NO_ACTION", "Aucune action spécifiée"},
    {"INVALID_SESSION_ID", "L'ID de session est invalide"},
    {"USER_NOT_FOUND", "L'utilisateur est introuvable"},
    {"INVALID_KEY", "La clé est invalide"},
    {"KEY_ALREADY_EXIST", "La clé existe déjà"},
    {"USER_ALREADY_EXIST", "L'utilisateur existe déjà"},
    {"INCORRECT_PASSWORD", "Le mot de passe est incorrect"},
    {"USER_BANNED", "Vous êtes banni !"}
    }

    Public Sub ErrorMsg(Text As String)
        MessageBox.Show(Text, "Erreur", MessageBoxButtons.OK, MessageBoxIcon.Error)
    End Sub

    Public Function GetResponse(SessionID As String, URL As String) As String
        Dim Result As String
        Dim WC As New System.Net.WebClient

        Try
            Result = WC.DownloadString(URL)
            Result = RC4(Result, SessionID)
            Return Result
        Catch ex As Exception
            ErrorMsg("La connection au serveur est impossible :(")
            Return Nothing
        End Try
    End Function

    Public Function CheckError(Text As String) As Integer
        Dim Array As String()
        Dim Message As String = "Erreur Inconnue"

        If Not Text.StartsWith("ERROR") Then
            Return False
        End If
        Array = Text.Split(":")
        If Array.Length = 2 AndAlso ErrorMessages.ContainsKey(Array(1)) Then
            Message = ErrorMessages(Array(1))
        End If
        ErrorMsg(Message)
        Return True
    End Function

    Public Function RandomChar(Lenght As Integer) As String
        Dim Chr() As Char = "abcdefghijklmnopqrstuvwxyz0123456789"
        Dim Result As String = ""
        For i = 1 To Lenght
            Result &= Chr(Random(Chr.Length - 1))
        Next
        Return Result
    End Function

    Public Function Random(Max As Integer)
        Randomize()
        Return Rnd() * Max
    End Function

    Public Function RC4(ByVal message As String, ByVal password As String) As String
        Dim i As Integer = 0
        Dim j As Integer = 0
        Dim cipher As New System.Text.StringBuilder
        Dim returnCipher As String = String.Empty
        Dim sbox As Integer() = New Integer(256) {}
        Dim key As Integer() = New Integer(256) {}
        Dim intLength As Integer = password.Length
        Dim a As Integer = 0
        While a <= 255
            Dim ctmp As Char = (password.Substring((a Mod intLength), 1).ToCharArray()(0))
            key(a) = Microsoft.VisualBasic.Strings.Asc(ctmp)
            sbox(a) = a
            System.Math.Max(System.Threading.Interlocked.Increment(a), a - 1)
        End While
        Dim x As Integer = 0
        Dim b As Integer = 0
        While b <= 255
            x = (x + sbox(b) + key(b)) Mod 256
            Dim tempSwap As Integer = sbox(b)
            sbox(b) = sbox(x)
            sbox(x) = tempSwap
            System.Math.Max(System.Threading.Interlocked.Increment(b), b - 1)
        End While
        a = 1
        While a <= message.Length
            Dim itmp As Integer = 0
            i = (i + 1) Mod 256
            j = (j + sbox(i)) Mod 256
            itmp = sbox(i)
            sbox(i) = sbox(j)
            sbox(j) = itmp
            Dim k As Integer = sbox((sbox(i) + sbox(j)) Mod 256)
            Dim ctmp As Char = message.Substring(a - 1, 1).ToCharArray()(0)
            itmp = Asc(ctmp)
            Dim cipherby As Integer = itmp Xor k
            cipher.Append(Chr(cipherby))
            System.Math.Max(System.Threading.Interlocked.Increment(a), a - 1)
        End While
        returnCipher = cipher.ToString
        cipher.Length = 0
        Return returnCipher
    End Function
End Module
 
Retour
Haut