123 School Work

HOME F.A.Q. REGISTER LOGIN SEARCH  
Essay Topics
Acceptance
Art
Business
Custom Written
Direct Essays
English
Example Essays
Foreign
History
Medical
Mega Essays
Miscellaneous
Movies
Music
Novels
People
Politics
Pre-Written
Religion
Science
Search
Speeches
Sports
Technology
Over 101,000 Essays and Term Papers!!

Featured Papers from Rad Essays

1. ECONOMICS
2. Etailing
3. ECommerce
4. Marketing Strategy and ECommerce
5. Target.Direct: Customer Purchasing Satisfaction in Ecommerc
This is only a preview of the paper
Click here to register and get the full text.
Existing members click here to login

e-retailing

using System; using System.Collections; using System.ComponentModel; using System.Configuration; using System.Data; using System.Data.SqlClient; using System.Drawing; using System.Web; using System.Web.SessionState; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.HtmlControls; using System.Web.Security; using System.Security.Cryptography; namespace CMT { /// /// Summary description for Login. /// public class Login : System.Web.UI.Page { protected System.Web.UI.WebControls.Label Label3; protected System.Web.UI.WebControls.Button Button1; protected System.Web.UI.WebControls.TextBox TextBox1; protected System.Web.UI.WebControls.Label Label2; protected System.Web.UI.WebControls.TextBox TextBox2; protected System.Web.UI.WebControls.Image Image1; protected System.Web.UI.WebControls.Label Label4; protected System.Web.UI.WebControls.Button Button2; protected System.Web.UI.WebControls.Label Label1; private static string CreateSalt(int size) { RNGCryptoServiceProvider rng = new RNGCryptoServiceProvider(); byte[] buff = new byte[size]; return Convert.ToBase64String(buff); } private static string CreatePasswordHash(string pwd, string salt) { string saltAndPwd = String.Concat(pwd, salt); string hashedPwd = FormsAuthentication.HashPasswordForStoringInConfigFile(saltAndPwd, "SHA1"); return hashedPwd; } private void StoreAccountDetails(string userName, string passwordHash, string salt) { SqlConnection conn = new SqlConnection(ConfigurationSettings.AppSettings["ConnectionString"]); SqlCommand cmd = new SqlCommand ("RegisterUser", conn); cmd.CommandType = CommandType.StoredProcedure; SqlParameter sqlParam = null; sqlParam = cmd.Parameters.Add("@userName", SqlDbType.VarChar, 255); sqlParam.Value =userName; sqlParam = cmd.Parameters.Add("@passwordHash ", SqlDbType.VarChar, 40); sqlParam.Value = passwordHash; sqlParam = cmd.Parameters.Add("@salt", SqlDbType.VarChar, 10); sqlParam.Value =salt; try { conn.Open(); cmd.ExecuteNonQuery(); } catch(Exception ex) { throw new Exception("Registration Complete"); } finally { conn.Close(); } } private bool VerifyPassword(string suppliedUserName, string suppliedPassword) { bool passwordMatch = false; SqlConnection conn = new SqlConnection(ConfigurationSettings.AppSettings["ConnectionString"]) ; SqlCommand cmd = new SqlCommand("LookupUser", conn); cmd.CommandType = CommandType.StoredProcedure; SqlParameter sqlParam = cmd.Parameters.Add("@userName", SqlDbType.VarChar,255); sqlParam.Value = suppliedUserName; try { conn.Open(); SqlDataReader reader = cmd.ExecuteReader(); reader.Read(); string dbPasswordHash = reader.GetString(0); string salt = reader.GetString(1); reader.Close(); string passwordAndSalt = String.Concat(suppliedPassword, salt); string hashedPasswordAndSalt = FormsAuthentication.HashPasswordForStoringInConfigFile(passwordAndSalt,"SHA1"); passwordMatch = hashedPasswordAndSalt.Equals(dbPasswordHash); } catch (Exception ex) { throw new Exception (ex.Message); } finally { conn.Close(); } return passwordMatch; } private void Page_Load(object sender, System.EventArgs e) { // Put user code to initialize the page here } #region Web Form Designer generated code override protected void OnInit(EventArgs e) { // // CODEGEN: This call is required by the ASP.NET Web Form Designer.


Approximate Word count = 511
Approximate Pages = 2
(250 words per page double spaced)
Over 101,000 Essays and Term Papers!!
Links
SWOT analysis for TESCO

my essay

Comtrust provides a range of e Retailing solutions that enab

retail

retail

my essay

Support
F.A.Q.
Custom Essays
Payment
123 School Work
Forgot Password?
Activation Email
More Links
All Papers Are For Research And Reference Purposes Only! You may not turn these papers in as your own! You must cite our web site as your source!
Copyright 2003-2008 123schoolwork.com. All rights reserved.