• 大小: 13.89MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-07-13
  • 语言: C#
  • 标签: asp.net  C#  

资源简介

asp.net 图片管理系统(C#)asp.net 图片管理系统(C#) asp.net 图片管理系统(C#)asp.net 图片管理系统(C#) asp.net 图片管理系统(C#)asp.net 图片管理系统(C#)

资源截图

代码片段和文件信息

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 AddImage : System.Web.UI.Page
{
    protected void Page_Load(object sender EventArgs e)
    {

    }
    protected void Wizard1_FinishButtonclick(object sender WizardNavigationEventArgs e)
    {
       
    }
    protected void Wizard1_FinishButtonclick1(object sender WizardNavigationEventArgs e)
    {
        if (TextBox1.Text == ““)
        {
            Page.RegisterStartupscript(“errl“ “ript>alert(‘图片名称不能为空!‘)ript>“);
            Wizard1.ActiveStepIndex = 0;
            TextBox1.Focus();
            return;
        }
        if (FileUpload1.FileName == ““)
        {
            Page.RegisterStartupscript(“err2“ “ript>alert(‘请选择要上传的图片!‘)ript>“);
            Wizard1.ActiveStepIndex = 1;
            return;
        }
        string imageUrl = ““;
        string imageServerUrl = ““;
        string imageClientUrl = FileUpload1.FileName;
       
        string imageExtendName = imageClientUrl.Substring
            (imageClientUrl.LastIndexOf(“.“) + 1);
       
        if (imageExtendName == “jpg“ || imageExtendName == “bmp“ || imageExtendName == “png“ || imageExtendName == “gif“)
        {
            imageUrl = “Photo/“ + DateTime.Now.ToString(“yyyyMMddhhmmssff“) + “.“ + imageExtendName;
            imageServerUrl = Server.MapPath(imageUrl);
            FileUpload1.SaveAs(imageServerUrl);
        }
        else
        {
            Page.RegisterStartupscript(“err3“ “ript>alert(‘请上传格式为pngbmpgif.jpg的图片!‘ript>)“);
            Wizard1.ActiveStepIndex = 1;
            return;
        }
        SqlConnection imageConnect = new SqlConnection
        (ConfigurationManager.ConnectionStrings
        [“imageConnectionString“].ToString());
        imageConnect.Open();
        SqlCommand imageCommand = new SqlCommand(“insert into t_ImageInfo (ImageNameImageClassImageTextImageUrlUploadDate) values(‘“ + TextBox1.Text + “‘‘“ + DropDownList1.SelectedValue + “‘‘“ + TextBox2.Text + “‘‘“ + imageUrl + “‘getdate())“ imageConnect);
        int affectRows = imageCommand.ExecuteNonQuery();
        if (affectRows <= 0)
        {
            Page.RegisterStartupscript(“err4“ “ript>alert(‘上传失败,请重新上传!‘)ript>“);
            Wizard1.ActiveStepIndex = 0;
        }
        else
        {
            Page.RegisterStartupscript(“err5“ “ript>alert(‘上传成功!‘)ript>“);
            TextBox1.Text = ““;
            TextBox2.Text = ““;
            Image1.ImageUrl = imageUrl;
            Image1.Visible = true;
            Wizard1.ActiveStepIndex = 0;
        }
        imageConnect.Close();
    }
}

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

     文件       3852  2009-04-13 08:46  ImageManage\AddImage.aspx

     文件       3036  2009-04-13 08:55  ImageManage\AddImage.aspx.cs

     文件    1048576  2009-04-13 09:13  ImageManage\App_Data\image_Data.MDF

     文件    1048576  2009-04-13 09:13  ImageManage\App_Data\image_Log.LDF

     文件        627  2009-04-08 21:00  ImageManage\ImageView.aspx

     文件       1752  2009-04-08 20:56  ImageManage\ImageView.aspx.cs

     文件      29726  2008-01-04 11:12  ImageManage\img\Banner.gif

     文件       4691  2009-04-08 19:18  ImageManage\Index.aspx

     文件        779  2009-04-08 15:48  ImageManage\Index.aspx.cs

     文件       2968  2009-04-13 08:57  ImageManage\ModifyImage.aspx

     文件       3990  2009-04-13 08:58  ImageManage\ModifyImage.aspx.cs

     文件       1449  2009-04-13 08:56  ImageManage\Mountain.aspx

     文件       1535  2009-04-13 08:56  ImageManage\Mountain.aspx.cs

     文件       2664  2008-01-18 09:20  ImageManage\Photo\.svn\entries

     文件          2  2008-01-04 11:12  ImageManage\Photo\.svn\format

     文件         53  2008-01-04 11:12  ImageManage\Photo\.svn\prop-base\2007110605174653.jpg.svn-base

     文件         53  2008-01-04 11:12  ImageManage\Photo\.svn\prop-base\2007110605205823.jpg.svn-base

     文件         53  2008-01-04 11:12  ImageManage\Photo\.svn\prop-base\2007110605211146.jpg.svn-base

     文件         53  2008-01-04 11:12  ImageManage\Photo\.svn\prop-base\2007110605213118.jpg.svn-base

     文件         53  2008-01-04 11:12  ImageManage\Photo\.svn\prop-base\2007110605214181.jpg.svn-base

     文件         53  2008-01-04 11:12  ImageManage\Photo\.svn\prop-base\2007110605215203.jpg.svn-base

     文件         53  2008-01-04 11:12  ImageManage\Photo\.svn\prop-base\2007110605220603.jpg.svn-base

     文件         53  2008-01-04 11:12  ImageManage\Photo\.svn\prop-base\2007110605221806.jpg.svn-base

     文件         53  2008-01-04 11:12  ImageManage\Photo\.svn\prop-base\2007110605223989.jpg.svn-base

     文件         53  2008-01-04 11:12  ImageManage\Photo\.svn\prop-base\2007110605225004.jpg.svn-base

     文件         53  2008-01-04 11:12  ImageManage\Photo\.svn\prop-base\2007110605225943.jpg.svn-base

     文件         53  2008-01-04 11:12  ImageManage\Photo\.svn\prop-base\2007110605231125.jpg.svn-base

     文件         53  2008-01-04 11:12  ImageManage\Photo\.svn\prop-base\2007110605232054.jpg.svn-base

     文件         53  2008-01-04 11:12  ImageManage\Photo\.svn\prop-base\2007110605233412.jpg.svn-base

     文件         53  2008-01-04 11:12  ImageManage\Photo\.svn\prop-base\2007110605234582.jpg.svn-base

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

评论

共有 条评论