Create password string - CSharp Security

CSharp examples for Security:Password

Description

Create password string

Demo Code


using System.Text;
using System.Globalization;
using System.Collections.Specialized;
using System.Collections;
using System;//from  w  w  w.j av  a  2 s  .  com

public class Main{
        /// <summary>
        /// Create password string
        /// </summary>
        /// <param name="originalText">Original text</param>
        /// <returns>String</returns>
        public static string CreatePasswordString( string originalText )
        {
            if ( originalText == null )
                throw new ArgumentNullException( "originalText",
                    "Unable to execute this method without valid string." );

            string passwordString = "";
            for ( int i = 0; i < originalText.Length; i++ )
                passwordString += "*";
            return passwordString;
        } // CreatePasswordString(originalText)
}

Related Tutorials