Tuesday, July 8, 2008

Cewrvical Position Before Menstration

password access to an application in VB.NET

can be devised various strategies to protect access to an application by password. For example dehabilitar all controls (if they are within the panels will be easier;)) and enable them to enter the correct password.
The one we show here is to validate password from a login form and if validation is correct to invoke the main form. Address it in this way allows us to show several interesting tidbits in developing WinForms applications.
The first thing we do is open a new project (
Winforms Application
choose and will name him "ClavedeAcceso." We then have a project with a form called Form1 , we will make this the main application form. Now add a new form that is where we ask the password and if correct call to Form1. We
right click on the name of the project -> Add -> Windows Form s and select Windows Forms and name we put FormAcceso and click on Add. This will be our initial form. If you do not save the project so far is a good time:) will configure FormAcceso as we see in the picture:

"We shot" on the Form a label, a textbox named txtpass Two buttons names and btnAcpetarPass btnCancelarPass and complete the text properties of objects as shown in Fig. This will be our initial form and if the user enters the correct code redirects to the main form and it will leave the application. For this we right-click the project name and clicked on the shortcut menu
Properties.
uncheck the checkbox "Enable framework application" and in the drop-down Startup Object "select" Sub Main
. " is from "Sub Main" where we actually invoke to forms. Let's add a class file to add the code in "Sub Main
." Right-click the Project Explorer
we and choose Add Class . We left the name Class1.vb for now. In the class file write the following code:
Public Class Class1

Public Shared Sub Main () Application.EnableVisualStyles () Dim
fAcceso
As New
FormAcceso
If fAcceso. ShowDialog () = Then
System.Windows.Forms.DialogResult.OK fAcceso.Close () Application.Run (New Form1) End If



End Sub End Class
SUB Main will be the entry point for our application and create a form
FormAcceso type where the user is prompted for the password. Then ask for the result of fAcceso.ShowDialog ()
and if this is
System.Windows.Forms.DialogResult.OK then close the login form and call the principal. fAcceso.Close () Application.Run (New Form1)
Now we have to set FormAcceso
to return System.Windows.Forms.DialogResult.OK if the password is correct. Let's see how.
The OK button's click event write the following code: Private Sub btnAceptarPass_Click (ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAceptarPass.Click If txtpass.Text = "password" Then Me . DialogResult = Windows.Forms.DialogResult.OK
Me.DialogResult = Windows.Forms.DialogResult.No Else End If

Hide () End Sub


Here if we return the correct key in the value OK DialogResult:

Me.DialogResult = Windows.Forms.DialogResult.OK


To be completed Cancel button (and if the user ran the application just to see what it was:)) in DialgoResult Cancel refund.
btnCancelarPass_Click Private Sub (ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCancelarPass.Click Me.DialogResult = Windows.Forms.DialogResult.Cancel
Hide () End Sub


addition, we will give user that when you type Enter the password and is validated. For this program the textbox's KeyPress event: Private Sub
txtpass_KeyPress (ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtpass.KeyPress
If (e.KeyChar = Convert.ToChar (Keys.Return)) Or (e.KeyChar = Convert.ToChar (Keys.Enter)) Then
btnAceptarPass_Click (Nothing, Nothing)

End If End Sub KeyPress


The event runs each time the user presses a key and in this case compared to Enter and Return. We know the key to
Orima e.KeyChar
and
Convert.ToChar (Keys.Enter) compared with Enter. Keys is a list containing all the keys you can press the user. Inquire in ... It is interesting .. :) In this case the key is embedded in the code. In another article we will see any other alternative to save it.

Monday, July 7, 2008

Average Bmi For American Women Over 20

Care Tips Our Homes. Habemus





Dear, here are some tips suggested by Carabineros de Chile for our protection.