İnputbox ta Password Karakteri Kulanma
Tarih
04/11/2010 15:12
Konu Sahibi
gitarc
Yorumlar
1
Okunma
1817
Konuyu Oyla:
  • Derecelendirme: 5/5 - 1 oy
  • 5
  • 4
  • 3
  • 2
  • 1

Derecelendirme: 5/5 - 1 oy



gitarc
Aktif Üye
Kullanici Avatari
Aktif Üye
14
01/11/2010
0
Balıkesir
Ofis XP
02/07/2011,15:21
unutmadan bunu bir kere kullanırsanız programda kullanacağınız butun inputboxlar şifreli olur

Visual Basic Code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
Public Class Form1

Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Int32
Private Declare Function GetWindow Lib "user32" (ByVal hwnd As Int32, ByVal wCmd As Int32) As Int32
Public Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Int32, ByVal wMsg As Int32, ByVal wParam As Int32, ByVal lParam As Int32) As Int32

Dim inputTitle As String = "Enter the Password!"
Dim returnedPW As String
Const asteriskKeyCode = 42
Public Const EM_SETPASSWORDCHAR = &HCC
Public Const WM_CREATE = &H1
Dim windowHandle As Int32
Public Const GW_CHILD = 5

Public Sub setPassword()
Dim editWindow As Int32
editWindow = GetWindow(windowHandle, GW_CHILD)
SendMessage(editWindow, EM_SETPASSWORDCHAR, asteriskKeyCode, 0)
End Sub
Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)
MyBase.WndProc(m)
If m.Result.ToInt32 = WM_CREATE Then
windowHandle = FindWindow(vbNullString, inputTitle)
ElseIf windowHandle > 0 Then
setPassword()
windowHandle = 0
End If
End Sub

Private Sub btnDisplay_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDisplay.Click
lblPw.Text = "InputBox Password:"
returnedPW = InputBox("Enter the Password In the box!", inputTitle, "password!", 0)
If Not returnedPW = Nothing AndAlso returnedPW = "password!" Then
lblPw.Text = "InputBox Password Is: " & returnedPW
Else
lblPw.Text = "InputBox Password Is: Wrong!"
MessageBox.Show("Wrong Password!", " Try Again")
End If
End Sub
End Class

PROGRAMMER MEHMET
Cevapla


ercansahin
BlackEagle
Kullanici Avatari
Uzman
E.... Ş....
3.739
14/11/2008
Ankara
Ofis 2010 32 Bit
07/12/2016,23:51
Teşekkürler Sn gitarc..
Cevapla







Konuyu Okuyanlar: 1 Ziyaretçi



Türkçe Çeviri: MCTR, Forum Yazılımı: MyBB, © 2002-2016 MyBB Group.
DMCA.com Protection Status
© Desing by XSTYLED| Develops by ozanakkaya