Click here to Skip to main content
15,893,790 members
Articles / Security / Cryptography

Encrypt & Decrypt Strings in Silverlight

Rate me:
Please Sign up or sign in to vote.
5.00/5 (4 votes)
31 Jul 2012CPOL2 min read 25.3K   803   5  
A very brief article about the implementation of encryption and decryption of a string in Silverlight Business Application
namespace Encrypt_Decrypt_SBA
{
    using System.Windows;
    using System.Windows.Controls;
    using System.Windows.Navigation;
    using Encrypt_Decrypt_SBA.LoginUI;

    /// <summary>
    /// Clase <see cref="UserControl"/> que proporciona la IU principal de la aplicación.
    /// </summary>
    public partial class MainPage : UserControl
    {
        /// <summary>
        /// Crea una nueva instancia de <see cref="MainPage"/>.
        /// </summary>
        public MainPage()
        {
            InitializeComponent();
        }

        /// <summary>
        /// Una vez que el Frame navegue, asegúrese de que el <see cref="HyperlinkButton"/> que representa a la página actual esté seleccionado
        /// </summary>
        private void ContentFrame_Navigated(object sender, NavigationEventArgs e)
        {
            foreach (UIElement child in LinksStackPanel.Children)
            {
                HyperlinkButton hb = child as HyperlinkButton;
                if (hb != null && hb.NavigateUri != null)
                {
                    if (hb.NavigateUri.ToString().Equals(e.Uri.ToString()))
                    {
                        VisualStateManager.GoToState(hb, "ActiveLink", true);
                    }
                    else
                    {
                        VisualStateManager.GoToState(hb, "InactiveLink", true);
                    }
                }
            }
        }

        /// <summary>
        /// Si se produce un error durante la navegación, mostrar una ventana de error
        /// </summary>
        private void ContentFrame_NavigationFailed(object sender, NavigationFailedEventArgs e)
        {
            e.Handled = true;
            ErrorWindow.CreateNew(e.Exception);
        }
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Architect
Paraguay Paraguay
hristian Amado is a professional software engineer, professional developer and trainer with over 18 years of experience building applications for Windows Desktop and the Web. Located in Asuncion, Paraguay, He's well involved in many Microsoft's technologies including XAML, C#, X++, WCF, ADO.NET and ASP.NET.

He holds a several Microsoft certifications including Microsoft Certified Professional Developer (MCPD), Microsoft Certified IT Professional, Microsoft Certified Technology Specialist and Microsoft Office Specialist.

Comments and Discussions