Mode Design disparu..

aaa2017 - Modifié le 10 nov. 2020 à 10:16
Whismeril Messages postés 19028 Date d'inscription mardi 11 mars 2003 Statut Non membre Dernière intervention 24 avril 2024 - 26 janv. 2021 à 14:26
Bonjour,

Sous visual Studio 2010 Ultimate.
Mon application presque fini, je voulais juste remettre en forme mes 3 forms et boum catastrophe je ne peux plus y accéder..
Cela me le fais sur mon troisième form.

Voici ce qui se trouve dans le Designer.vb concerné:


<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
    Partial Class Frmverif
        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()
            Me.SuspendLayout()
            '
            'Frmverif
            '
            Me.ClientSize = New System.Drawing.Size(284, 262)
            Me.Name = "Frmverif"
            Me.Text = "Frmverif"
            Me.ResumeLayout(False)

        End Sub
        Friend WithEvents txtnump As System.Windows.Forms.TextBox
        Friend WithEvents keypub As System.Windows.Forms.Label
        Friend WithEvents Label1 As System.Windows.Forms.Label
        Friend WithEvents txtnumM As System.Windows.Forms.TextBox
        Friend WithEvents Label2 As System.Windows.Forms.Label
        Friend WithEvents txtnums1 As System.Windows.Forms.TextBox
        Friend WithEvents Label3 As System.Windows.Forms.Label
        Friend WithEvents Label4 As System.Windows.Forms.Label
        Friend WithEvents Label5 As System.Windows.Forms.Label
        Friend WithEvents Label6 As System.Windows.Forms.Label
        Friend WithEvents Label7 As System.Windows.Forms.Label
        Friend WithEvents txtnumbezout As System.Windows.Forms.TextBox
        Friend WithEvents txtnumw As System.Windows.Forms.TextBox
        Friend WithEvents txtnumu1 As System.Windows.Forms.TextBox
        Friend WithEvents txtnumu2 As System.Windows.Forms.TextBox
        Friend WithEvents txtnumv As System.Windows.Forms.TextBox
        Friend WithEvents BtnVérif As System.Windows.Forms.Button
        Friend WithEvents Label8 As System.Windows.Forms.Label
        Friend WithEvents Label9 As System.Windows.Forms.Label
        Friend WithEvents Label10 As System.Windows.Forms.Label
        Friend WithEvents txtnumq As System.Windows.Forms.TextBox
        Friend WithEvents txtnumg As System.Windows.Forms.TextBox
        Friend WithEvents txtnumy As System.Windows.Forms.TextBox
        Friend WithEvents Label11 As System.Windows.Forms.Label
        Friend WithEvents txtnums2 As System.Windows.Forms.TextBox
        Friend WithEvents BtnClear As System.Windows.Forms.Button
        Friend WithEvents BtnFermer As System.Windows.Forms.Button
        Friend WithEvents Label16 As System.Windows.Forms.Label
        Friend WithEvents TxtFichierSigné As System.Windows.Forms.TextBox
        Friend WithEvents BtnFichierCompare As System.Windows.Forms.Button
        Friend WithEvents TxtFichierComparé As System.Windows.Forms.TextBox
        Friend WithEvents Label13 As System.Windows.Forms.Label
        Friend WithEvents Label15 As System.Windows.Forms.Label
        Friend WithEvents Label12 As System.Windows.Forms.Label
        Friend WithEvents Panel1 As System.Windows.Forms.Panel
        Friend WithEvents Panel2 As System.Windows.Forms.Panel
        Friend WithEvents ShapeContainer1 As Global.Microsoft.VisualBasic.PowerPacks.ShapeContainer
        Friend WithEvents RectangleShape1 As Global.Microsoft.VisualBasic.PowerPacks.RectangleShape
        Friend WithEvents RectangleShape2 As Global.Microsoft.VisualBasic.PowerPacks.RectangleShape
        Friend WithEvents Label14 As System.Windows.Forms.Label
        Friend WithEvents Label17 As System.Windows.Forms.Label
        Friend WithEvents Label18 As System.Windows.Forms.Label
        Friend WithEvents RectangleShape3 As Global.Microsoft.VisualBasic.PowerPacks.RectangleShape
        Friend WithEvents RectangleShape4 As Global.Microsoft.VisualBasic.PowerPacks.RectangleShape
        Friend WithEvents LineShape1 As Global.Microsoft.VisualBasic.PowerPacks.LineShape

    'Protected Overrides Sub Finalize()
    '   MyBase.Finalize()
    'End Sub

    'Public Sub New()

    ' Cet appel est requis par le concepteur.
    'InitializeComponent()

    ' Ajoutez une initialisation quelconque après l'appel InitializeComponent().

    'End Sub
End Class





Voici ce qui se trouve dans le code de mon form que je le trouve vide après l'exécution:

Imports System
Imports System.IO
Imports System.Text
Imports System.Security.Cryptography
Imports System.Security.Cryptography.SHA1
Imports System.Security
Imports System.Windows.Forms
Imports System.Security.Principal

Public Class Frmverif

    Dim w, u1, u2, v As Integer
    Dim s1, s2, M As Integer
    Dim p, q, g, y As Integer
    Dim a, b, k, n As Integer
    Dim r, c, t, d As Integer
    Dim encryptedtext As String
    Dim sha1 As SHA1CryptoServiceProvider
    Dim AES As AesCryptoServiceProvider
    Dim key As KeyedHashAlgorithm
    Dim DSA As DSACryptoServiceProvider
    Private _truncateHash As String
    Dim z As String = "this is where you put in a secret key "
    Private _decryptText As String


    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnVérif.Click

        If 0 < Val(txtnums1.Text) < Val(txtnumq.Text) And 0 < Val(txtnums2.Text) < Val(txtnumq.Text) Then

            s2 = Val(txtnums2.Text)
            q = Val(txtnumq.Text)

            a = 1
            b = 0
            k = 0
            n = 1

            While q > 0

                r = s2 Mod q
                c = (s2 - r) / q

                t = a
                d = b
                a = k
                b = n

                k = t - c * k
                n = d - c * n

                s2 = q
                q = r

            End While

            If a > b Then
                txtnumbezout.Text = a
            Else : txtnumbezout.Text = b
            End If

            w = Val(txtnumbezout.Text) Mod Val(txtnumq.Text)
            txtnumw.Text = w

            u1 = (Val(txtnumM.Text) * w) Mod Val(txtnumq.Text)
            txtnumu1.Text = u1

            u2 = (Val(txtnums1.Text) * w) Mod Val(txtnumq.Text)
            txtnumu2.Text = u2

            v = (((Val(txtnumg.Text) ^ u1) * (Val(txtnumy.Text) ^ u2)) Mod Val(txtnump.Text)) Mod Val(txtnumq.Text)
            txtnumv.Text = v
        End If

        If Val(txtnums1.Text) = 0 Or Val(txtnums1.Text) > Val(txtnumq.Text) Or Val(txtnums2.Text) = 0 Or Val(txtnums2.Text) > Val(txtnumq.Text) Then
            MsgBox("rejeter la signature, les valeurs de 's1' ou 's2' sont incorrects. Veuillez réessayer.")
        End If

        If Val(txtnumv.Text) = Val(txtnums1.Text) And Val(txtnums1.Text) <> 0 And Val(txtnums2.Text) <> 0 Then
            MsgBox("la signatue est valide")

        ElseIf v <> s1 Or s1 = 0 Or Val(txtnums2.Text) = 0 Then
            MsgBox("la signature n'est pas valide")
        End If

    End Sub

    Private Sub BtnClear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnClear.Click
        txtnump.Clear()
        txtnumq.Clear()
        txtnumg.Clear()
        txtnumy.Clear()
        txtnumM.Clear()
        txtnums1.Clear()
        txtnums2.Clear()
        txtnumbezout.Clear()
        txtnumw.Clear()
        txtnumu1.Clear()
        txtnumu2.Clear()
        txtnumv.Clear()
    End Sub

    Private Sub BtnFermer_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnFermer.Click
        Close()
    End Sub

    Private Sub BtnFichierClair_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnFichierCompare.Click

        Debug.WriteLine(String.Compare(TxtFichierSigné.Text, TxtFichierComparé.Text))

        If TxtFichierSigné.Text = TxtFichierComparé.Text Then

            MsgBox("le fichier signé est valide")
        Else
            MsgBox("le fichier signé est invalide")
        End If

    End Sub

5 réponses

Whismeril Messages postés 19028 Date d'inscription mardi 11 mars 2003 Statut Non membre Dernière intervention 24 avril 2024 656
Modifié le 9 nov. 2020 à 21:49
Pour ton problème.

Deux possibilités me viennent à l'esprit et à toi aussi, puisque tu as posté le designer
  • ça a planté au moment ou VS écrivait dans le designer et patatras
  • tu as bidouillé dans le designer et repatatras.


C'est assez compliqué de corriger le designer, et c'est bien pour ça que le fichier est caché dans visual studio et que dedans c'est écrit

        'Elle peut être modifiée à l'aide du Concepteur Windows Form.  
        'Ne la modifiez pas à l'aide de l'éditeur de code.

C'est mieux en couleur que dans un rectangle gris non?


Bref, ton formulaire n'a pas l'air bien gros, tu as encore accès au code behind pour le copier coller.
A mon avis, le plus rapide sera de déplacer les 3 fichier de ton formulaire dans un autre répertoire, et de le recréer dans visual studio.
Puis de copier coller, le code behind dans les évènements.

0
Whismeril Messages postés 19028 Date d'inscription mardi 11 mars 2003 Statut Non membre Dernière intervention 24 avril 2024 656
9 nov. 2020 à 21:48
Pour ne pas te retrouver dans la même situation à nouveau.

Y'a pas de mystère, il faut sauvegarder.

Peut-être comme beaucoup de gens, tu penses que "Ctrl+S", ou cliquer sur "Enregistrer" ou encore l'icône "Disquette" sauvegarde. Mais non, ça enregistre.

Une fois enregistré, c'est figé, c'est comme ça et pas autrement.
En plus Visual Studio, il enregistre sans que tu lui demandes quand il compile, même quand ça plante.

Sauvegarder c'est pouvoir revenir en arrière.

Y'a plein de méthodes, moi je préconise GIT, parce que en plus ça permet de travailler seul sur plusieurs ordinateurs ou en équipe (mais c'est pas obligé).
Le truc un peu pénible avec GIT, c'est que ça fonctionne en ligne de commande, mais des éditeurs ont créé des interfaces fenêtrées.
Perso je me sers de SourceTree, et j'ai fait un petit tuto dessus https://codes-sources.commentcamarche.net/faq/11714-suivre-les-versions-d-un-code-source-avec-git-et-sourcetree
0
Bonjour,

j'ai refais le 3ème formulaire et c réglé,

au niveau de mon PC, l'application s'exécute bien où j'ai réalisé,

j'ai copié l'exécutable de l'application à un autre PC : le 1er et le 3ème formulaire s'ouvrent normale et le 2ème ne s'ouvrent pas et il m'affiche un message d'erreur.
merci
0
Bonjour,

j'ai essayé d'envoyé le message d'erreur sous forme image et n'a pas réussi car je ne suis pas un membre,

comment faire?
0

Vous n’avez pas trouvé la réponse que vous recherchez ?

Posez votre question
Whismeril Messages postés 19028 Date d'inscription mardi 11 mars 2003 Statut Non membre Dernière intervention 24 avril 2024 656
26 janv. 2021 à 14:26
Bonjour

Pour insérer une image, il faut faire comme décrit là https://codes-sources.commentcamarche.net/faq/10686-le-nouveau-codes-sources-comment-ca-marche#insertion-via-le-bouton-d-edition
Je ne voies pas de raison pour qu’un non membre ne puisse pas envoyer d’image.
Par contre un bloqueur de pub peut l’empêcher.
(Ps quand on est membre, y’a pas de pub)

Par contre s’agissant d’un problème différent, merci de marquer celui-ci résolu et d’ouvrir un nouveau sujet.
0
Rejoignez-nous