Traduire un code en vb.net

dmic Messages postés 7 Date d'inscription samedi 13 septembre 2008 Statut Membre Dernière intervention 3 octobre 2008 - 3 oct. 2008 à 23:43
nhervagault Messages postés 6063 Date d'inscription dimanche 13 avril 2003 Statut Membre Dernière intervention 15 juillet 2011 - 4 oct. 2008 à 00:31
Salut,
Je suis un debutant en vb.net, est-ce que vous pouvez traduire ce code ci-dessous pour moi en vb.net.
Merci.
Begin VB.Form frm_Login

BackColor = &H8000000D&

BorderStyle = 1
'Fixed SingleCaption "..::: Login :::.."ClientHeight 1500

ClientLeft = 45

ClientTop = 360

ClientWidth = 4035
LinkTopic "Form1"MaxButton 0

'FalseMinButton = 0

'FalseScaleHeight = 1500

ScaleWidth = 4035

StartUpPosition = 2

'CenterScreenBegin VB.CommandButton cmd_OK
Caption "Login"Height 375

Left = 2280

TabIndex = 4

Top = 960

Width = 1455

EndBegin VB.TextBox txt_PassWord

Height = 285

IMEMode = 3

'DISABLELeft = 2040
PasswordChar "€"TabIndex 3

Top = 600

Width = 1695

EndBegin VB.TextBox txt_UserName

ForeColor = &H80000012&

Height = 285

Left = 2040

TabIndex = 1

Top = 240

Width = 1695

EndBegin VB.Label lbl_PassWord

Alignment = 1

'Right JustifyBackStyle = 0
'TransparentCaption "PassWord : "ForeColor &H8000000F&

Height = 255

Left = 600

TabIndex = 2

Top = 600

Width = 1335

EndBegin VB.Label lbl_UserName

Alignment = 1

'Right JustifyBackStyle = 0
'TransparentCaption "UserName : "ForeColor &H8000000F&

Height = 255

Left = 600

TabIndex = 0

Top = 240

Width = 1335

EndBegin VB.Image img_Icon

Height = 480

Index = 2

Left = 240
Picture "frm_Login.frx":0000Top 240

Width = 480

EndBegin VB.Image img_BG

Height = 600

Left = 0
Picture "frm_Login.frx":0584Stretch -1

'TrueTop = 0

Width = 600

EndEnd
Attribute VB_Name "frm_Login"Attribute VB_GlobalNameSpace
FalseAttribute VB_Creatable FalseAttribute VB_PredeclaredId

TrueAttribute VB_Exposed =

FalsePrivate

Sub cmd_OK_Click()

Dim un
As
String, pw
As
String

Const cun
As
String =
"ac80b86e5a37ef7c0a535c01ba8b5e00"

Const cpw
AsString "aa8af3ebe14831a7cd1b6d1383a03755"un mod_MD5.MD5(

Me.txt_UserName.Text)pw = mod_MD5.MD5(

Me.txt_PassWord.Text)

If (cun = un)
And (cpw = pw)
Then

'ValidUnload

Mefrm_Prog.Show

ElseIf (cun <> un)
Or (cpw <> pw)
Then

'BadMsgBox

"Nom d'utilisateur ou/et mot-de-passe incorrect(s)", vbExclamation,
"PrOuT"

Me.txt_UserName.Text =
""

Me.txt_PassWord.Text =
""

Me.txt_UserName.SetFocus

End
IfEnd

SubPrivate

Sub Form_Load()Prog.LoadBG

MeEnd

SubPrivate

Sub txt_PassWord_KeyDown(KeyCode
As
Integer, Shift
As
Integer)

If KeyCode = 13
Then cmd_OK_Click
End

SubPrivate

Sub txt_UserName_KeyDown(KeyCode
As
Integer, Shift
As
Integer)

If KeyCode = 13
Then
Me.txt_PassWord.SetFocus
End

Sub

1 réponse

nhervagault Messages postés 6063 Date d'inscription dimanche 13 avril 2003 Statut Membre Dernière intervention 15 juillet 2011 37
4 oct. 2008 à 00:31
Salut,

C'est pas compliqué à traduire

1 --> Tu prends une form tu position
les controles 2 label et 2 textbox 1 button et 1 image

2 --> Pour le md5 tu utilises le MD5 de dotnet
Solution rapide extraite de codyx
   Public Shared Function
HashMD5(ByVal Chaine As String) As String
        Return System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(Chaine, "md5")
    End Function

3 --> Pour la gestion des evenements clavier
Recherche sur internet et tu trouveras

Si tu veux apprendre vb.net, il faut le faire par soi meme un peu ;-)

Bonne traduction
0
Rejoignez-nous