------sifrele.aspx------
<%@ Page Language="vb" autoeventwireup="false" Src="sifrele.aspx.vb" Inherits="sifreleyici" %>
<html>
<head>
<title>?ifreleme</title>
</head>
<body >
<form id="Form1" method="post" runat="server">
<div style="BORDER-RIGHT: 2px groove; BORDER-TOP: 2px groove; FONT-SIZE: x-small; Z-INDEX: 101; LEFT: 8px; BORDER-LEFT: 2px groove; WIDTH: 512px; BORDER-BOTTOM: 2px groove; FONT-FAMILY: Verdana; POSITION: absolute; TOP: 8px; HEIGHT: 248px" ms_positioning="GridLayout">
<asp:TextBox id="sifrelenecek" style="Z-INDEX: 100; LEFT: 136px; POSITION: absolute; TOP: 24px" runat="server" Width="152px"></asp:TextBox>
<asp:Label id="Label1" style="Z-INDEX: 101; LEFT: 24px; POSITION: absolute; TOP: 30px" runat="server" Width="104px">?ifrelenecek Metin veya Sayy:</asp:Label>
<asp:Button id="sifrele" style="Z-INDEX: 103; LEFT: 32px; POSITION: absolute; TOP: 144px" runat="server" Width="113px" Text="?ifrele"></asp:Button>
<asp:Label id="Label2" style="Z-INDEX: 106; LEFT: 32px; POSITION: absolute; TOP: 197px" runat="server" Width="96px"> ?ifrelenmi? ?ekli:</asp:Label>
<asp:TextBox id="sifrelenmis" style="Z-INDEX: 102; LEFT: 136px; POSITION: absolute; TOP: 192px" runat="server" Width="354px" ReadOnly="True"></asp:TextBox>
</div>
</form>
</body>
</html>
A?a?ydaki kodda önemli olan System.Web.Security synyfyny import etmemiz.E?er import etmezseniz “FormsAuthentication.HashPasswordForStoringInConfigFile “ de?eri hata verecektir.?ifreleme butonuna vermi? oldu?umuz olayda ise ilk textbox de?erini “FormsAuthentication.HashPasswordForStoringInConfigFile” olayyny kullanarak ?ifrelememiz.” FormsAuthentication.HashPasswordForStoringInConfigFile(sifrelenecek.text, “SHA1”)” olayynda SHA1 .net framework tarafyndan desteklenen bir algoritma. SHA1 yerine MD5 yazarsanyz de?i?ik bir algoritmayla ?ifrelemi? olursunuz.Yyi Çaly?malar
------sifrele.aspx.vb------
Imports System.Web.Security
Public Class sifreleyici
Inherits System.Web.UI.Page
Protected WithEvents sifrele As System.Web.UI.WebControls.Button
Protected WithEvents Label1 As System.Web.UI.WebControls.Label
Protected WithEvents sifrelenecek As System.Web.UI.WebControls.TextBox
Protected WithEvents sifrelenmis As System.Web.UI.WebControls.TextBox
Protected WithEvents Label2 As System.Web.UI.WebControls.Label
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
End Sub
Private Sub sifrele_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles sifrele.Click
sifrelenmis.Text = FormsAuthentication.HashPasswordForStoringInConfigFile(sifrelenecek.Text, "SHA1")
End Sub
End Class