Beispiel #1
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            string            name     = name_box.Text;
            string            category = category_box.Text;
            string            period   = period_box.Text;
            string            museum   = museum_box.Text;
            string            intro    = intro_box.Text;
            string            author   = author_box.Text;
            SqlServerDataBase sdb      = new SqlServerDataBase();

            string stroresqlstring = "insert into Image_info(Url,Tag,Intro,category,Museum,Period,Author) values ('" + Image1.ImageUrl + "','" + name + "','" + intro + "','" + category + "','" + museum + "','" + period + "','" + author + "')";
            bool   stroeFlag       = sdb.Insert(stroresqlstring, null);

            if (stroeFlag == true)
            {
                Response.Write("<script>alert('保存成功!');</script>");
            }
            else
            {
                Response.Write(sdb.ErrorMessage);
            }
        }
        protected void Button1_Click(object sender, EventArgs e)
        {
            string name     = name_box.Text;
            string category = category_box.Text;
            string period   = period_box.Text;
            string museum   = museum_box.Text;
            string intro    = intro_box.Text;

            System.Diagnostics.Debug.Write(Session["path"]);
            const int num = 128;
            //计算图像中已标定的文物目标的特征值
            ImageProc roiImg = new ImageProc(Session["path"].ToString());

            int[] hist_hsv = new int[num];
            roiImg.GetHSVHistogram(hist_hsv);
            //string str_hsv = GetCharaStr(hist_hsv, num);    //color descriptor
            Image_Color newColor = new Image_Color();

            System.Diagnostics.Debug.Write(hist_hsv);
            double[] shape_hu = new double[7];
            roiImg.GetShapeFeature(ref shape_hu);     //Shape descriptor
            Image_Shape newShape = new Image_Shape();

            System.Diagnostics.Debug.Write(shape_hu);
            SqlServerDataBase sdb = new SqlServerDataBase();

            string stroresqlstring = "insert into Image_info(Url,Tag,Intro,category,Museum,Period) values ('" + Image1.ImageUrl + "','" + name + "','" + intro + "','" + category + "','" + museum + "','" + period + "')";
            bool   stroeFlag       = sdb.Insert(stroresqlstring, null);

            if (stroeFlag == true)
            {
                Response.Write("<script>alert('保存成功!');</script>");
            }
            else
            {
                Response.Write("<script>alert(\"" + sdb.ErrorMessage + "\");</script>");
            }
        }
Beispiel #3
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            string            name     = name_box.Text;
            string            category = category_box.Text;
            string            period   = period_box.Text;
            string            museum   = museum_box.Text;
            string            author   = author_box.Text;
            SqlServerDataBase sdb      = new SqlServerDataBase();

            string  stroresqlstring = "select  * from Image_info where tag='" + name + "' or Category='" + category + "' or Period='" + period + "' or Museum='" + museum + "' or Author='" + author + "'";
            DataSet ds = sdb.Select(stroresqlstring, null);

            if (sdb.ErrorMessage != null)
            {
                int _length = ds.Tables[0].Rows.Count;
                ListView1.DataSource = ds;
                ListView1.DataBind();
            }
            else
            {
                Response.Write(sdb.ErrorMessage);
            }
        }