• 大小: 341KB
    文件类型: .rar
    金币: 2
    下载: 1 次
    发布日期: 2021-06-24
  • 语言: C#
  • 标签: asp.net  .net  C#  

资源简介

实现了电子通讯录系统,功能包括用户注册、用户登录、修改密码、添加好友、添加好友联系方式、修改好友联系方式、删除好友联系方式等。 \MyAddressList \DB \MyAddressList.sql 电子通讯录系统数据数据库创建脚本 \MyAddressList \DB \MyAddressList.bak 电子通讯录系统数据数据库备份 \MyAddressList \Images\ 电子通讯录系统图片文件夹 \MyAddressList \Styles\Stye.css 电子通讯录系统样式表文件 \MyAddressList \Login.aspx 登录页面 \MyAddressList

资源截图

代码片段和文件信息

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;

public partial class AddressAdd : System.Web.UI.Page
{
    protected void Page_Load(object sender EventArgs e)
    {
        if (this.Session[“userID“]== null)
        {
            Response.Redirect(“Login.aspx“);
        }
    }
    protected void btnBack_Click(object sender EventArgs e)
    {
        Response.Redirect(“AddressList.aspx“);
    }
    protected void btnSubmit_Click(object sender EventArgs e)
    {
        SqlConnection conn = new SqlConnection(ConfigurationManager.AppSettings[“DBConnectionString“]);
        SqlCommand insertCmd = new SqlCommand(“insert into AddressLists(userIdfrdNamefrdPhonefrdMobilePhonefrdAddressfrdEmailfrdQQ) values(@userId@Name@Phone@MobilePhone@Address@Email@QQ)“ conn);
        insertCmd.Parameters.Add(“@userId“ SqlDbType.VarChar 15);        
        insertCmd.Parameters.Add(“@Name“ SqlDbType.VarChar 10);        
        insertCmd.Parameters.Add(“@Phone“ SqlDbType.VarChar 15);
        insertCmd.Parameters.Add(“@MobilePhone“ SqlDbType.VarChar 11);        
        insertCmd.Parameters.Add(“@Address“ SqlDbType.VarChar 200);
        insertCmd.Parameters.Add(“@Email“ SqlDbType.VarChar 50);
        insertCmd.Parameters.Add(“@QQ“ SqlDbType.VarChar 15);
        insertCmd.Parameters[“@userId“].Value = Session[“userID“].ToString();
        insertCmd.Parameters[“@Name“].Value = txtName.Text;
        insertCmd.Parameters[“@Phone“].Value = txtUtel2.Text;
        insertCmd.Parameters[“@MobilePhone“].Value = txtUtel3.Text;        
        insertCmd.Parameters[“@Address“].Value = txtUaddr.Text;
        insertCmd.Parameters[“@Email“].Value = txtUemail.Text;
        insertCmd.Parameters[“@QQ“].Value = txtUQQ.Text;
        try
        {
            conn.Open();
            int flag = insertCmd.ExecuteNonQuery();
            if (flag > 0)
            {
                Response.Write(“ript language=javascript>alert(‘成功添加好友记录!‘)ript>“);
            }
            else
            {
                Response.Write(“ript language=javascript>alert(‘添加好友记录失败,查看输入是否正确!‘)ript>“);
            }
        }
        catch (System.Exception ee)
        {
            Response.Write(“ript language=javascript>alert(‘“ + ee.Message.ToString() + “‘)ript>“);
        }
        finally
        {
            conn.Close();
        }
    }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       3474  2007-03-05 17:25  C02\MyAddressList\AddressAdd.aspx

     文件       2740  2007-03-05 17:25  C02\MyAddressList\AddressAdd.aspx.cs

     文件       8097  2007-03-05 17:25  C02\MyAddressList\AddressList.aspx

     文件        527  2007-03-05 17:25  C02\MyAddressList\AddressList.aspx.cs

     文件    2293760  2009-03-13 12:59  C02\MyAddressList\App_Data\Database.mdf

     文件     573440  2009-03-13 12:59  C02\MyAddressList\App_Data\Database_log.LDF

     文件    1591808  2007-03-05 17:25  C02\MyAddressList\DB\MyAddressList.bak

     文件       1714  2009-03-13 12:50  C02\MyAddressList\DB\MyAddressList.sql

     文件        444  2009-03-12 14:52  C02\MyAddressList\Default.aspx

     文件        409  2009-03-12 14:52  C02\MyAddressList\Default.aspx.cs

     文件       1194  2007-03-05 17:25  C02\MyAddressList\Images\ADD.GIF

     文件       2857  2007-03-05 17:25  C02\MyAddressList\Images\Logo.jpg

    ..A.SH.      8704  2007-03-05 17:25  C02\MyAddressList\Images\Thumbs.db

     文件       2052  2009-03-12 10:56  C02\MyAddressList\Login.aspx

     文件       2022  2009-03-13 12:55  C02\MyAddressList\Login.aspx.cs

     文件       2657  2007-03-05 17:25  C02\MyAddressList\ModifyPwd.aspx

     文件       2398  2007-03-05 17:25  C02\MyAddressList\ModifyPwd.aspx.cs

     文件       1207  2007-03-05 17:25  C02\MyAddressList\OK.gif

     文件       7889  2007-03-05 17:25  C02\MyAddressList\Register.aspx

     文件       5960  2007-03-05 17:25  C02\MyAddressList\Register.aspx.cs

     文件       1531  2007-03-05 17:25  C02\MyAddressList\styles\style.css

     文件       1967  2009-03-13 12:54  C02\MyAddressList\Web.Config

     文件        166  2007-03-05 17:25  C02\readme.txt

     目录          0  2009-03-17 09:39  C02\MyAddressList\App_Data

     目录          0  2009-03-17 09:39  C02\MyAddressList\DB

     目录          0  2009-03-17 09:39  C02\MyAddressList\Images

     目录          0  2009-03-17 09:39  C02\MyAddressList\styles

     目录          0  2009-03-17 09:39  C02\MyAddressList

     目录          0  2009-03-17 09:39  C02

----------- ---------  ---------- -----  ----

............此处省略2个文件信息

评论

共有 条评论