Lo siguiente es un sistema de login hecho en c++ el cual lo pueden utilizar en las aplicaciones que ustedes mismo realicen.
/* * main.cpp * * Created on: 30/06/2013 * Author: francves */#include iostream#include stdlib.husing namespace std;void login();int main(){ login(); return 0;}void login(){ string nombre; string pass; int i; for(i=1; i4; i++){ system("cls"); cout endl; cout " BIENVENIDO AL SISTEMA DE LOGIN " endl; cout "___________________________________________" endl; cout endl; cout "Por favor ingrese su informacion de usuario" endl; cout endl; cout "¿Nombre de usuario?" endl; cin nombre; if(nombre == "admin"){ cout "Nombre de usuario correcto, por favor ingrese su contrasena:" endl; cin pass; if(pass == "admin123"){ cout endl; cout "Contrasena correcta, bienvenido, sera redirigido a la aplicacion" endl; system("pausenull"); exit(0); } else if(pass != "admin123"){ cout "Contrasena incorrecta, por favor ingrese un usuario y contrasena valida" endl; system("pausenull"); } } else if(nombre != "admin"){ cout "Nombre de usuario incorrecto, por favor ingrese su nombre de usuario nuevamente" endl; system("pausenull"); } if(i 0){ cout endl; cout "Ha realizado " i "/3 intentos" endl; cout endl; system("pausenull"); } if(i == 3){ cout endl; cout "Ha realizado 3 intentos, por seguridad el programa se cerrara..." endl; system("pausenull"); exit(0); } }}
Donde están las instrucciones if y else podrán cambiar el usuario "admin" y la contraseña "admin123" por las que ustedes deseen.
if(nombre == "admin"){ cout "Nombre de usuario correcto, por favor ingrese su contrasena:" endl; cin pass; if(pass == "admin123"){ cout endl; cout "Contrasena correcta, bienvenido, sera redirigido a la aplicacion" endl; system("pausenull"); exit(0); } else if(pass != "admin123"){ cout "Contrasena incorrecta, por favor ingrese un usuario y contrasena valida" endl; system("pausenull"); } } else if(nombre != "admin"){ cout "Nombre de usuario incorrecto, por favor ingrese su nombre de usuario nuevamente" endl; system("pausenull"); }
El contador de intentos nos asegura que el usuario se puede equivocar solo 3 veces, y de hacerlo, la aplicación se cerrará exit(0).
if(i 0){ cout endl; cout "Ha realizado " i "/3 intentos" endl; cout endl; system("pausenull"); } if(i == 3){ cout endl; cout "Ha realizado 3 intentos, por seguridad el programa se cerrara..." endl; system("pausenull"); exit(0); }
structered settlement alabama mesothelioma lawyer mesothelioma settlement amounts PSYCHIC FOR FREE Online casino truck accident attorney los angeles Nunavut Culture Life Insurance Co Lincoln best consolidation loan student Royalty free images stock Hire php programmers DUI lawyer personal injury accident lawyer DONATING A CAR IN MARYLAND boca raton personal injury attorney Mesothelioma Law Firm PHD on Counseling Education Personal Injury Law Firm New social media platforms injury attorney baton rouge chicago hair laser removal FUTURISTIC ARCHITECTURE Casino Insurance Companies Make money online Australia earthlink business internet cheap car insurance in virginia Auto Mobile Shipping Quote Mobile casino BEST CRIMINAL LAWYER IN ARIZONA Donate Old Cars to Charity Online Motor Insurance Quotes accident attorneys orange county Best Seo company Hire php developer Italian cooking school Register Free Domains personal injury solicitor Business Voip Solutions Email bulk service Donate car to charity California Donating a Car in Maryland domain registration yahoo Casino reviews Car Donate mortgage adviser Forensics online course hughes net business mesothelioma attorney california Donate a Car in Maryland cheaper insurance companies world trade center footage Html email Home Phone Internet Bundle MESOTHELIOMA LAW FIRM CHEAP CAR INSURANCE IN VIRGINIA motorcycle accident attorney chicago Hire php developers Data Recovery Raid mesothelioma law suit broward county dui lawyer Forex Trading Platform Live casino most profitable internet business alcohol rehab center in florida structured settlements companies mesothelioma help Gas/Electricity Christmas cards mesothelioma charities domain name yahoo truck accident attorney texas structured settlements annuities personal injury attorney ocala fl Donate old cars to charity WordPress themes for designers Online Christmas cards Criminal lawyer Donate Car for Tax Credit Futuristic Architecture ONLINE MOTOR INSURANCE QUOTES motor insurance quotes cell cycle regulation ppt Dwi lawyer Seo services Personal Injury Lawyers How to Donate A Car in California federal criminal defense attorney Seo companies car accident lawyer michigan MET AUTO Massage School Dallas Texas Dallas mesothelioma attorneys Service business software Social media strategies Criminal defense lawyer workers compensation lawyer los angeles Insurance colorado auto accident attorney Php programmers for hire email bulk service Paperport promotional code Holland Michigan College mesothelioma trial attorney CAR ACCIDENT LAWYERS hair removal washington dc Bankruptcy lawyer Proud Italian cook tucson car accident attorney Computer science classes online city college in miami Php programmers WordPress theme designers Best social media platforms for business HOW TO DONATE A CAR IN CALIFORNIA Business finance group Structures Annuity Settlement CAR INSURANCE QUOTES UTAH Social media platforms for business Custom WordPress theme designer Life insurance co Lincoln houston mesothelioma attorney accident attorney san bernardino california law lemon MASSAGE SCHOOL DALLAS TEXAS Dayton freight lines Business management software Best social media platforms Seo company Custom Christmas cards sell structured settlement calculator Photo Christmas cards asbestos lawyers buying an annuity calculator FORENSICS ONLINE COURSE Donate your Car for Money WordPress hosting Learning adobe illustrator Psd to WordPress Donate Your Car for Kids Forensics Online Course World trade center footage Social media examiner CHEAP CAR INSURANCE FOR LADIES EMAIL BULK SERVICE Dallas Mesothelioma Attorneys Social media management Tech school car insurance quotes mn NUNAVUT CULTURE mesothelioma lawyer chicago st louis mesothelioma attorney Social media platforms Car Insurance Quotes PA Psd to html Criminal Defense Attorneys Florida mesothelioma lawyer texas donate your car for money Automobile Accident Attorney online colledges best mesothelioma lawyers Email Bulk Service Adobe illustrator classes saskatchewan auto insurance BETTER CONFERENCING CALLS Car insurance quotes Colorado Social media tools Social media campaigns Donate Car to Charity California Best Criminal Lawyers in Arizona Donate Your Car Sacramento VIRTUAL DATA ROOMS Car Insurance in South Dakota Donate Cars in MA mesothelioma claim accident lawyers in los angeles lease management software Car Insurance Quotes Colorado Sell Annuity Payment Asbestos Lawyers DONATE CARS IN MA home phone internet bundle Annuity Settlements Online Classes ANNUITY SETTLEMENT business administration masters Dayton Freight Lines Hard drive Data Recovery Services mesotheloma Motor Replacements structured settlement investments Cheap Domain Registration Hosting Donate Cars Illinois motorcycle accident attorney sacramento Car Insurance Quotes Utah PAPERPORT PROMOTIONAL CODE World Trade Center Footage mesothelioma attorney assistance HOLLAND MICHIGAN COLLEGE injury lawyers Online Colleges structured settlement company car accident lawyers west palm beach Paperport Promotional Code structured settlement quote CAR INSURANCE IN SOUTH DAKOTA CAR INSURANCE QUOTES MN auto accident attorney Cheap car insurance for ladies donate old cars to charity Better Conference Calls mesothelioma survival rates Psychic for Free Car Accident Lawyers yahoo web hosting Low Credit Line Credit Cards Cheap Car Insurance for Ladies selling annuity payments for cash Car Insurance Quotes MN HARDDRIVE DATA RECOVERY SERVICES miami personal injury attorney mesothelioma lawyer asbestos cancer lawsuit Cheap Auto Insurance in VA Met Auto attorney lawyer mesothelioma Donate a car in Maryland massage school dallas texas Donating Used Cars to Charity Neuson DONATE YOUR CAR FOR KIDS caraccidentlawyer sell your structured settlement payments selling structured settlement Royalty Free Images Stock CHEAP AUTO INSURANCE IN VA Webex Costs Cheap Car Insurance in Virginia WEBEX COSTS DONATE YOUR CAR SACRAMENTO asterisk call center software Mortgage Adviser mesothelioma attorney florida injury lawyers west palm beach ONLINE COLLEDGES best criminal lawyer in arizona Virtual Data Rooms Online College Course Auto Accident Attorney Donate cars Illinois Car Insurance Companies
