asp设计

    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="PlantDetection.aspx.cs" Inherits="PlantDetection" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>植物检测</title>
    <link rel="stylesheet" type="text/css" href="/style/main.css" />
    <link rel="stylesheet" type="text/css" href="/style/index.css" />
</head>
<body runat="server">
    <p>
           
    </p>
    <p>
         
    </p>
    <p>
         
    </p>
    <p>
         
    </p>
    <div class="header-page">
        <div class="inner">
            <asp:HyperLink ID="HyperLink1" runat="server" CssClass="logo"><img src="../img/face-logo.png" alt="Face Detection" /></asp:HyperLink>
            <div class="nav">
                <div class="nav-li">
                    <ul>
                        <li>
                            <asp:HyperLink ID="plant" runat="server" NavigateUrl="/PlantDetection.aspx">植物检测</asp:HyperLink></li>
                        <li>
                            <asp:HyperLink ID="detection" runat="server" NavigateUrl="/FaceDetection.aspx">人脸检测</asp:HyperLink></li>
                        <li>
                            <asp:HyperLink ID="match" runat="server" NavigateUrl="/FaceMatch.aspx">人脸对比</asp:HyperLink></li>
                        <li>
                            <asp:HyperLink ID="contact" runat="server" NavigateUrl="/Contact.aspx">联系</asp:HyperLink></li>
                        <li>
                            <asp:HyperLink ID="about" runat="server" NavigateUrl="/About.aspx">关于</asp:HyperLink></li>
                        <li>
                            <asp:HyperLink ID="login" runat="server" NavigateUrl="/Account/Login.aspx">登录</asp:HyperLink></li>
                        <li>
                            <asp:HyperLink ID="register" runat="server" NavigateUrl="/Account/Register.aspx">注册</asp:HyperLink></li>
                    </ul>
                </div>
            </div>
        </div>
    </div>
    <div style="text-align: center;">
        <h1>功能演示</h1>
        <p>即刻体验植物检测。请上传一张本地图片或提供图片URL。</p>
        <p>该功能演示基于Baidu Detect API搭建</p>
    </div>
    <form id="form1" runat="server" style="text-align: center">
        <div style="float: left; margin-top: 56px; margin-left: 300px;">
            <br />
            <asp:Image runat="server" ID="showPic" Style="z-index: 102; left: 20px; position: center; top: 49px;" Width="377px" Height="335px" />
            <br />
            <br />
            <asp:FileUpload ID="picFile" runat="server" Width="152px" Style="visibility: hidden;"/>
            <input type="text" readonly="readonly" id="represent" class="inputtext"/>
            <input type="button" value="上传图片" id="up" style="margin-bottom: 0px" class="btn"  />
                               
             <asp:Button ID="submit" runat="server" Text="识别" Width="100px" CssClass="btn" Style="margin-bottom: 0px" OnClick="submit_Click" />
        </div>
                     
        <div style="float: right; margin-top: 56px; margin-right: 300px;">
            <div>
                <asp:Label ID="tip" runat="server" Text="▼植物属性分析"></asp:Label>
            </div>
            <asp:TextBox ID="plantAttribute" οnmοuseοver="this.style.borderColor='beige';this.style.backgroundColor='#CCCCCC'" ReadOnly="true" TextMode="MultiLine" runat="server" Height="332px" Style="background-color:#53868B;margin-top: 0px; font-family: 微软雅黑; font-size: 20px; font-weight: bold;" Width="376px"></asp:TextBox>
            <br />
            <br />
            <asp:TextBox ID="netUrl" runat="server" CssClass="inputtext"></asp:TextBox>
                
            <asp:Button ID="netSubmit" runat="server" Text="识别网络图片" Width="116px" Onclick="netSubmit_Click" CssClass="btn" />
              
        </div>
        <br />
        <br />
    </form>
    <div>
        <asp:Literal runat="server" ID="messge" Text=""></asp:Literal>
        <br />
    </div>
    <script src="/JS/jquery-3.2.1.min.js" charset="utf-8"></script>
    <script src="/JS/process.js" charset="utf-8"></script>
</body>
</html>



public partial class PlantDetection : System.Web.UI.Page
{

    string scrpit = "<script language='javascript'> {0} </script>";
    protected void Page_Load(object sender, EventArgs e)
    {
        this.showPic.ImageUrl = "/img/demo-plant.jpg";
    }

    protected void submit_Click(object sender, EventArgs e)
    {
        HttpContext context = HttpContext.Current;
        HttpResponse response = context.Response;

        if (!this.picFile.HasFile) 
        {
            //response.Write(string.Format(scrpit, "alert(\"上传文件不能为空!\");"));
            this.messge.Text = string.Format(scrpit, "alert(\"上传文件不能为空!\");");
            return;
        }

        bool fileIsValid = false;
        //如果确认了上传文件,则判断文件类型是否符合要求 
        if (this.picFile.HasFile)
        {
            //获取上传文件的后缀 
            String fileExtension = System.IO.Path.GetExtension(this.picFile.FileName).ToLower();
            String[] restrictExtension = { ".jpg", ".png" };
            //判断文件类型是否符合要求 
            for (int i = 0; i < restrictExtension.Length; i++)
            {
                if (fileExtension == restrictExtension[i])
                {
                    fileIsValid = true;
                }
                //如果文件类型符合要求,调用SaveAs方法实现上传,并显示相关信息 
                if (fileIsValid == true)
                {
                    //上传文件是否大于10M
                    if (picFile.PostedFile.ContentLength > (4 * 1024 * 1024))
                    {

                        this.messge.Text = string.Format(scrpit, "alert(\"上传单个图片不能超过4MB!\");");
                        return;
                    }
                    try
                    {
                        this.picFile.SaveAs(Server.MapPath("~/File/") + picFile.FileName);
                        this.showPic.ImageUrl = "~/File/" + picFile.FileName;
                    }
                    catch
                    {
                        this.messge.Text = string.Format(scrpit, "alert(\"文件上传失败!\");");
                    }
                    finally
                    {

                    }
                }
                else
                {
                    this.messge.Text = string.Format(scrpit, "alert(\"只能够上传后缀为.jpg,.png的文件!\");");
                }
            }

        }

        string result = new PlantDetect().detectPlant(Server.MapPath("~/File/") + picFile.FileName);
        this.plantAttribute.Text = result;
    }
    protected void netSubmit_Click(object sender, EventArgs e)
    {
        string url = netUrl.Text.Trim();
        this.showPic.ImageUrl = url;

        string json = new PlantDetect().detectPlantFromNet(url);
       
        this.plantAttribute.Text = json;
    }


}





<%@ Page Language="C#" AutoEventWireup="true" CodeFile="FaceDetection.aspx.cs" Inherits="FaceDetection" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>人脸检测</title>
    <link rel="stylesheet" type="text/css" href="/style/main.css" />
    <link rel="stylesheet" type="text/css" href="/style/index.css" />
</head>
<body runat="server">
    <p>
           
    </p>
    <p>
         
    </p>
    <p>
         
    </p>
    <p>
         
    </p>
    <div class="header-page">
        <div class="inner">
            <asp:HyperLink ID="HyperLink1" runat="server" CssClass="logo"><img src="../img/face-logo.png" alt="Face Detection" /></asp:HyperLink>
            <div class="nav">
                <div class="nav-li">
                    <ul>
                        <li>
                            <asp:HyperLink ID="plant" runat="server" NavigateUrl="/PlantDetection.aspx">植物检测</asp:HyperLink></li>
                        <li>
                            <asp:HyperLink ID="detection" runat="server" NavigateUrl="/FaceDetection.aspx">人脸检测</asp:HyperLink></li>
                        <li>
                            <asp:HyperLink ID="match" runat="server" NavigateUrl="/FaceMatch.aspx">人脸对比</asp:HyperLink></li>
                        <li>
                            <asp:HyperLink ID="contact" runat="server" NavigateUrl="/Contact.aspx">联系</asp:HyperLink></li>
                        <li>
                            <asp:HyperLink ID="about" runat="server" NavigateUrl="/About.aspx">关于</asp:HyperLink></li>
                        <li>
                            <asp:HyperLink ID="login" runat="server" NavigateUrl="/Account/Login.aspx">登录</asp:HyperLink></li>
                        <li>
                            <asp:HyperLink ID="register" runat="server" NavigateUrl="/Account/Register.aspx">注册</asp:HyperLink></li>
                    </ul>
                </div>
            </div>
        </div>
    </div>

    <div style="text-align: center;">
        <h1>功能演示</h1>
        <p>即刻体验人脸检测。请上传一张本地图片或提供图片URL。</p>
        <p>该功能演示基于Baidu Detect API搭建</p>
    </div>
    <form id="form1" runat="server" style="text-align: center">
        <div style="float: left; margin-top: 56px; margin-left: 300px;display:inline;">
            <br />
            <asp:Image runat="server" ID="showPic" Style="z-index: 102; left: 20px; position: center; top: 49px;" Width="377px" Height="335px" />
            <br />
            <br />
            <asp:FileUpload ID="picFile" runat="server" Width="152px" Style="visibility: hidden;"/>
            <input type="text" readonly="readonly" id="represent" class="inputtext"/>
            <input type="button" value="上传图片" id="up" style="margin-bottom: 0px" class="btn"  />
                               
             <asp:Button ID="submit" runat="server" Text="检测" Width="100px" CssClass="btn" Style="margin-bottom: 0px" OnClick="submit_Click" />
        </div>
                     
        <div style="float: right; margin-top: 56px; margin-right: 300px; display:inline;">
            <div>
                <asp:Label ID="tip" runat="server" Text="▼人脸属性分析"></asp:Label>
            </div>
            <asp:TextBox ID="faceAttribute" οnmοuseοver="this.style.borderColor='beige';this.style.backgroundColor='#CCCCCC'" ReadOnly="true" TextMode="MultiLine" runat="server" Height="332px" Style="background-color: #53868B; margin-top: 0px; font-family: 微软雅黑; font-size: 20px; font-weight: bold;" Width="376px"></asp:TextBox>
            <br />
            <br />
            <asp:Button ID="netSubmit" runat="server" Text="检测网络图片" Width="116px" OnClick="netSubmit_Click" CssClass="btn" />
            <asp:TextBox ID="netUrl" runat="server" CssClass="inputtext"></asp:TextBox>
        </div>
        <br />
        <br />
    </form>
    <div>
        <asp:Literal runat="server" ID="messge" Text=""></asp:Literal>
        <br />
    </div>
    <script src="/JS/jquery-3.2.1.min.js" charset="utf-8"></script>
    <script src="/JS/process.js" charset="utf-8"></script>
</body>
</html>




public partial class FaceDetection : System.Web.UI.Page
{

    string scrpit = "<script language='javascript'> {0} </script>";

    protected void Page_Load(object sender, EventArgs e)
    {
        this.showPic.ImageUrl = "~/img/" + "timg.jpg";
    }

    protected void submit_Click(object sender, EventArgs e)
    {
        HttpContext context = HttpContext.Current;
        HttpResponse response = context.Response;

        if (picFile.FileName == "")
        {
            //response.Write(string.Format(scrpit, "alert(\"上传文件不能为空!\");"));
            this.messge.Text = string.Format(scrpit, "alert(\"上传文件不能为空!\");");
            return;
        }

        bool fileIsValid = false;
        //如果确认了上传文件,则判断文件类型是否符合要求 
        if (this.picFile.HasFile)
        {
            //获取上传文件的后缀 
            String fileExtension = System.IO.Path.GetExtension(this.picFile.FileName).ToLower();
            String[] restrictExtension = {".jpg", ".png" };
            //判断文件类型是否符合要求 
            for (int i = 0; i < restrictExtension.Length; i++)
            {
                if (fileExtension == restrictExtension[i])
                {
                    fileIsValid = true;
                }
                //如果文件类型符合要求,调用SaveAs方法实现上传,并显示相关信息 
                if (fileIsValid == true)
                {
                    //上传文件是否大于10M
                    if (picFile.PostedFile.ContentLength > (10 * 1024 * 1024))
                    {

                        this.messge.Text = string.Format(scrpit, "alert(\"上传单个图片不能超过10MB!\");");
                        return;
                    }
                    try
                    {
                        this.picFile.SaveAs(Server.MapPath("~/File/") + picFile.FileName);
                        this.showPic.ImageUrl = "~/File/" + picFile.FileName;
                    }
                    catch
                    {
                        this.messge.Text = string.Format(scrpit, "alert(\"文件上传失败!\");");
                    }
                    finally
                    {

                    }
                }
                else
                {
                    this.messge.Text = string.Format(scrpit, "alert(\"只能够上传后缀为.jpg,.png的文件!\");");
                }
            }

        }

        string json = new FaceDetet().DetectFaceFromLocal(Server.MapPath("~/File/") + picFile.FileName);

        //this.faceAttribute.Text = json;
        MemoryStream stream = new MemoryStream(Encoding.UTF8.GetBytes(json));
        JavaScriptSerializer Serializer = new JavaScriptSerializer();

        Root obj = Serializer.Deserialize<Root>(json);
        this.faceAttribute.Text = new FaceDetet().RootAnalyse(obj);
    }
    
    protected void netSubmit_Click(object sender, EventArgs e)
    {
        string url = netUrl.Text.Trim();
        this.showPic.ImageUrl = url;

        string json = new FaceDetet().DetectFaceFromNet(url);
        MemoryStream stream = new MemoryStream(Encoding.UTF8.GetBytes(json));
        JavaScriptSerializer Serializer = new JavaScriptSerializer();

        Root obj = Serializer.Deserialize<Root>(json);
        this.faceAttribute.Text = new FaceDetet().RootAnalyse(obj);
    }
}






<%@ Page Language="C#" AutoEventWireup="true" CodeFile="FaceMatch.aspx.cs" Inherits="FaceMatch" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>人脸对比</title>
    <link rel="stylesheet" type="text/css" href="/style/main.css" />
    <link rel="stylesheet" type="text/css" href="/style/index.css" />
</head>
<body runat="server">
    <p>
           
    </p>
    <p>
         
    </p>
    <p>
         
    </p>
    <p>
         
    </p>
    <div class="header-page">
        <div class="inner">
            <asp:HyperLink ID="HyperLink1" runat="server" CssClass="logo"><img src="../img/face-logo.png" alt="Face Detection" /></asp:HyperLink>
            <div class="nav">
                <div class="nav-li">
                    <ul>
                        <li>
                            <asp:HyperLink ID="plant" runat="server" NavigateUrl="/PlantDetection.aspx">植物检测</asp:HyperLink></li>
                        <li>
                            <asp:HyperLink ID="detection" runat="server" NavigateUrl="/FaceDetection.aspx">人脸检测</asp:HyperLink></li>
                        <li>
                            <asp:HyperLink ID="match" runat="server" NavigateUrl="/FaceMatch.aspx">人脸对比</asp:HyperLink></li>
                        <li>
                            <asp:HyperLink ID="contact" runat="server" NavigateUrl="/Contact.aspx">联系</asp:HyperLink></li>
                        <li>
                            <asp:HyperLink ID="about" runat="server" NavigateUrl="/About.aspx">关于</asp:HyperLink></li>
                        <li>
                            <asp:HyperLink ID="login" runat="server" NavigateUrl="/Account/Login.aspx">登录</asp:HyperLink></li>
                        <li>
                            <asp:HyperLink ID="register" runat="server" NavigateUrl="/Account/Register.aspx">注册</asp:HyperLink></li>
                    </ul>
                </div>
            </div>
        </div>
    </div>
    <div style="text-align: center;">
        <h1>功能演示</h1>
        <p>即刻体验人脸对比。请上传两张本地图片或提供图片URL对比人脸相似度。</p>
        <p>该功能演示基于Baidu Detect API搭建</p>
    </div>
    <form id="form1" runat="server">
        <div style="float: left; margin-top: 56px; margin-left: 200px;">
            <br />
            <div style="float: left; margin-right: 50px">
                <br />
                <asp:Image runat="server" ID="showPic1" ImageUrl="/img/demo-pic6.jpg" Style="z-index: 102; left: 20px; position: center; top: 49px;" Width="377px" Height="335px" />
                <br />
                <br />
                <div style="float: left">
                    <input type="text" readonly="readonly" id="repre1" class="inputtext"/>
                      
                <input type="button" id="up1" value="上传图片1" class="btn" />
                </div>
                <asp:FileUpload ID="picFile1" runat="server" Width="152px" Style="visibility: hidden; float: left;" />
            </div>
            <div style="float: right; margin-right: 50px;">
                <br />
                <asp:Image runat="server" ID="showPic2" ImageUrl="/img/demo-pic6.jpg" Style="z-index: 102; left: 20px; position: center; top: 49px;" Width="377px" Height="335px" />
                <br />
                <br />
                <div style="float: left">
                    <input type="text" readonly="readonly" id="repre2" class="inputtext" />
                      
                    <input type="button" id="up2" value="上传图片2" class="btn" />
                </div>
                <asp:FileUpload ID="picFile2" runat="server" Width="152px" Style="visibility: hidden; float: left;" />
            </div>
        </div>
                     
        <div style="float: right; margin-top: 56px; margin-right: 200px;">
            <div>
                <asp:Label ID="tip" runat="server" Text="▼人脸对比相似度(数值越高,相似度越大)"></asp:Label>
            </div>
            <asp:TextBox ID="similarityNum" ReadOnly="true" TextMode="MultiLine" οnmοuseοver="this.style.borderColor='beige';this.style.backgroundColor='#CCCCCC'" runat="server" Height="332px" Style="font-family: 微软雅黑;background-color: #53868B; margin-top: 0px; font-size:20px;font-weight:bold;" Width="405px"></asp:TextBox>
            <br />
            <br />
            <asp:Button ID="submit" runat="server" Text="对比检测" OnClick="submit_Click" CssClass="btn"  />
        </div>
                                 
    </form>
    <div>
        <asp:Literal ID="message" runat="server" Text=""></asp:Literal>
    </div>
    <script src="/JS/jquery-3.2.1.min.js" charset="utf-8"></script>
    <script>
        $(document).ready(function () {
            $("#up1").click(function () {
                $("#picFile1").click();
            });
            $("#picFile1").change(function () {
                $("#repre1").val($("#picFile1").val().trim());
            });

            $("#up2").click(function () {
                $("#picFile2").click();
            });
            $("#picFile2").change(function () {
                $("#repre2").val($("#picFile2").val().trim());
            });
        });
    </script>
</body>
</html>






public partial class FaceMatch : System.Web.UI.Page
{

    string script = "<script language='javascript'> {0} </script>";
    protected void Page_Load(object sender, EventArgs e)
    {

    }

    protected void submit_Click(object sender, EventArgs e)
    {
        HttpContext context = HttpContext.Current;
        HttpResponse response = context.Response;

        if (picFile1.FileName == "" || picFile2.FileName == "")
        {
            this.message.Text = string.Format(script, "alert(\"必须上传两个文件!\");");
            return;
        }

        bool fileIsValid = false;
        //如果确认了上传文件,则判断文件类型是否符合要求 
        if (this.picFile1.HasFile && this.picFile2.HasFile)
        {
            //获取上传文件的后缀 
            String fileExtension1 = System.IO.Path.GetExtension(this.picFile1.FileName).ToLower();
            String fileExtension2 = System.IO.Path.GetExtension(this.picFile2.FileName).ToLower();

            String[] restrictExtension = { ".jpg", ".png" };

            //判断文件类型是否符合要求 
            for (int i = 0; i < restrictExtension.Length; i++)
            {
                if (fileExtension1 == restrictExtension[i])
                {
                    for (int j = 0; j < restrictExtension.Length; j++)
                    {
                        if (fileExtension2 == restrictExtension[j])
                            fileIsValid = true;
                    }
                }
                //如果文件类型符合要求,调用SaveAs方法实现上传,并显示相关信息 
                if (fileIsValid == true)
                {
                    //上传文件是否大于10M
                    if (picFile1.PostedFile.ContentLength > (10 * 1024 * 1024) || picFile1.PostedFile.ContentLength > (10 * 1024 * 1024))
                    {
                        this.message.Text = string.Format(script, "alert(\"上传的单个图片不能大于10MB!\");");
                    }
                    try
                    {
                        this.picFile1.SaveAs(Server.MapPath("~/File/") + picFile1.FileName);
                        this.picFile2.SaveAs(Server.MapPath("~/File/") + picFile2.FileName);

                        this.showPic1.ImageUrl = "~/File/" + picFile1.FileName;
                        this.showPic2.ImageUrl = "~/File/" + picFile2.FileName;
                        string similarity = new FaceMatching().matchFace(Server.MapPath("~/File/") + picFile1.FileName, Server.MapPath("~/File/") + picFile2.FileName);

                        this.similarityNum.Text = "                 人脸对比相似度         \r\n\r\n" + "相似度指数(1~100):     " + similarity;
                    }
                    catch
                    {
                        this.message.Text = string.Format(script, "alert(\"上传图片失败!\");");
                    }
                    finally
                    {
                    }
                }
                else
                {
                    this.message.Text = string.Format(script, "alert(\"只能够上传后缀为.jpg,.png的文件!\");");
                }
            }
        }
    }
}


网上购物系统 摘 要 本文通过分析国内外网上购物系统的发展现状,提出了一种利用asp技术开发网上购物系统的方案,以期达到功能强大,费用低廉,通用性强,适合我国国情的购物网站系统。文中着重论述了该系统的功能与实现、数据流程与存储、网上购物、后台管理等 经分析,使用Microsoft公司的ASP(Active Server Pages)和相关网页开发工具,利用微软提供的IIS建立运行环境,再利用ODBC(数据源)建立数据连接关系。利用其提供的各种组件及内置对象,首先在短时间内建立数据库,然后,对数据库进行分析与建立ASP页面,不断修正与改进,直到功能基本实现的可行性购物系统。 关键词: 购物系统 ASP技术 电子商务 Abstract This article through analyzes the domestic and foreign on-line shopping system the development present situation, proposed one kind operates on the hairnet using the asp technology the shopping system plan, to the time achieved function formidable, expense inexpensive, the versatility is strong, suits our country national condition the shopping website system. In the article emphatically elaborated this system function and the realization, the data flow and the memory, the on-line shopping, the backstage management and so on. After the analysis, uses Microsoft Corporation ASP (Active Server Pages) and the correlation homepage development kit, provides the Disestablishment movement environment using Microsoft, again (data pool)establishes the data connection relations using ODBC. Each kind of module provides which using it and in sets at the object, first establishes the database in the short time, then, carries on to the database analyzes and establishes the ASP page, unceasingly revises and the improvement, until function basic realization feasible shopping system. KEYWORD:Shopping system ASP technology Electronic commerce 毕业设计+源码
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值