Silverlight Mail ve Şifre Kontrolü
Silverlight Mail ve Şifre Kontrolü. Girilen mail ve şifreyi kontrol ederek şifre ve mail adresinin doğruluğunu ve güvenirliğini kontrol eden program
-Mail adresi yanlış girilirse çeşitli renklerle ikaz ediyor
-Şifre 4 den kısa 7 den kısa ise çeşitli renklerle ikisinde de uyarıyor.
-Şifre tutarsız girilirse çeşitli renklerle uyarıyor
Uygulamanın MainPage.xaml dosyasının kodu:
<UserControl x:Class="soru1.MainPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="400" xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"> <Grid x:Name="LayoutRoot" Background="White"> <Canvas Height="170" HorizontalAlignment="Left" Margin="10,8,0,0" Name="canvas1" VerticalAlignment="Top" Width="348" Background="#E6CEB399"> <sdk:Label Canvas.Left="87" Canvas.Top="6" Height="28" Name="label1" Width="180" Content="Mail ve Şifre Kontrolü" Foreground="#FFF21313" FontSize="15" /> <sdk:Label Canvas.Left="45" Canvas.Top="38" Height="28" Name="label2" Width="120" Content="Mail Giriniz" /> <sdk:Label Canvas.Left="5" Canvas.Top="60" Height="28" Name="label3" Width="120" Content="Mail Tekrar Giriniz" /> <sdk:Label Canvas.Left="43" Canvas.Top="85" Height="28" Name="label4" Width="120" Content="Şifre Giriniz" /> <sdk:Label Canvas.Left="3" Canvas.Top="109" Height="28" Name="label5" Width="120" Content="Şifre Tekrar Giriniz" /> <sdk:Label Canvas.Left="231" Canvas.Top="39" Height="28" Name="label6" Width="120" /> <sdk:Label Canvas.Left="231" Canvas.Top="63" Height="28" Name="label7" Width="120" /> <sdk:Label Canvas.Left="230" Canvas.Top="88" Height="28" Name="label8" Width="120" /> <sdk:Label Canvas.Left="230" Canvas.Top="113" Height="28" Name="label9" Width="120" /> <TextBox Canvas.Left="109" Canvas.Top="39" Height="23" Name="textBox1" Width="120" TextChanged="textBox1_TextChanged" /> <TextBox Canvas.Left="109" Canvas.Top="63" Height="23" Name="textBox2" Width="120" TextChanged="textBox2_TextChanged" /> <TextBox Canvas.Left="109" Canvas.Top="88" Height="23" Name="textBox3" Width="120" TextChanged="textBox3_TextChanged" /> <TextBox Canvas.Left="109" Canvas.Top="113" Height="23" Name="textBox4" Width="120" TextChanged="textBox4_TextChanged" /> </Canvas> </Grid> </UserControl>
Uygulamanın MainPage.xaml.cs dosyasının kodu:
using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Windows; using System.Windows.Controls; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Animation; using System.Windows.Shapes; namespace soru1 { public partial class MainPage : UserControl { public MainPage() { InitializeComponent(); } private void textBox1_TextChanged(object sender, TextChangedEventArgs e) { } private void textBox2_TextChanged(object sender, TextChangedEventArgs e) { if (textBox1.Text != textBox2.Text) { label7.Foreground = new SolidColorBrush(Colors.Red); label7.Content = "Mail uyuşmazlığı"; } else { label7.Foreground = new SolidColorBrush(Colors.Green); label7.Content = "Mail Kabul Edildi"; } } private void textBox3_TextChanged(object sender, TextChangedEventArgs e) { int uzunluk; uzunluk = textBox3.Text.Length; if (uzunluk < 4) { label8.Foreground = new SolidColorBrush(Colors.Red); label8.Content = "Şifre Zayıf"; } else if (uzunluk < 7) { label8.Foreground = new SolidColorBrush(Colors.Yellow); label8.Content = "Şifre Normal"; } else { label8.Foreground = new SolidColorBrush(Colors.Green); label8.Content = "Şifre Güçlü"; } } private void textBox4_TextChanged(object sender, TextChangedEventArgs e) { if (textBox3.Text != textBox4.Text) { label9.Foreground = new SolidColorBrush(Colors.Red); label9.Content = "Şİfre uyuşmazlığı"; } else { label9.Foreground = new SolidColorBrush(Colors.Green); label9.Content = "Şifre Kabul Edildi"; } } } }
Uugulamanın ekran görüntüleri



Bu Yazıya Tepkin Nedir?
+1
+1
+1
+1
+1
+1
+1
<< Önceki Yazı
Sonraki Yazı >>
Silverlight, silverlight dersleri, silverlight kodları, silverlight kullanımı, Silverlight Mail ve Şifre Kontrolü, silverlight örnek kodları, silverlight örnek uygulamaları, silverlight örnekleri, silverlight uygulamaları