基于ASP.NET的新闻管理系统(三)代码展示

5.1.1栏目部分

增加栏目(addLanMu.aspx):

<html xmlns="http://www.w3.org/1999/xhtml">

<head runat="server">

    <title></title>

    <link rel="stylesheet" type="text/css" href="../css/style.css" />

    <style type="text/css">

    body{ background-image:url('backgroundimgs/bg003.jpg');background-size: cover;}

        #submitLanMu,#backlanmu

        {

            color:White;

            width:100px;

            height: 35px;

        outline: none;

        margin:10px 50px;

        border: none;

        

        line-height: 35px;

        border-radius: 50px;

        position: relative;

        border: rgba(255,255,255,0.2) 2px solid ;

        color: var(--color);

            -webkit-transition: 0.25s;

            transition: 0.25s;

          }

        #submitLanMu:hover,#submitLanMu:focus{box-shadow: inset 0 0 0 2em var(--hover);}

        #submitLanMu{--color: #a972cb;--hover: #cb72aa;}

        #backlanmu:hover,#backlanmu:focus {box-shadow: inset -3.5em 0 0 0 var(--hover), inset 3.5em 0 0 0 var(--hover);}

        #backlanmu{--color: #ff7f82; --hover: #ffdc7f;}

    </style>

</head>

<body>

    <form id="form1" runat="server">

    <div>

         <div id="addLanMuDiv">

            <div style=" text-align:center">增加栏目</div>

            <div class="addUserClass">

                <asp:Label ID="Label1" Text="栏目名:" runat="server" />

                <asp:TextBox ID="addLanMuName" runat="server" style="width:150px;  border:0px"></asp:TextBox>

            </div>

            <br />

            <asp:Button Text="确定" runat="server" ID="submitLanMu" 

                οnclick="submitUser_Click" />

             <asp:Button ID="backlanmu" runat="server" οnclick="back_Click" Text="返回" />

        </div>

    </div>

    </form>

</body>

</html>

 

编辑栏目(editLanMu.aspx):

<html xmlns="http://www.w3.org/1999/xhtml">

<head runat="server">

    <title></title>

    <link href="../css/style.css" rel="stylesheet" type="text/css" />

    <style type="text/css">

         body{ background-image:url('backgroundimgs/bg003.jpg');background-size: cover;}

         #submitEditLanMu,#backtolanmu

         {

             margin: 30px 20px;

              padding: 15px 20px;

              border-radius: 10px;

              border: 2px solid;

              font: 16px 'Open Sans', sans-serif;

              text-transform: uppercase;

              background: none;

              outline: none;

              cursor: pointer;

              -webkit-transition: all .5s;

              transition: all .5s;

          }

          #submitEditLanMu,#backtolanmu {color: #CEFFF1;border-color: #CEFFF1; overflow: hidden; position: relative;}

          #submitEditLanMu:hover,#backtolanmu:hover {color: #27323A;}

    </style>

</head>

<body>

    <form id="form1" runat="server">

    <div>

         <div id="editLanMuDiv" style=" height:150px; border:0">

            <div style=" text-align:center; color:White">编辑栏目</div>

            <div class="addUserClass">

                <asp:Label ID="Label1" Text="栏目名:" runat="server" />

                <asp:TextBox ID="editLanMu" runat="server" style="width:150px;  border:0px"></asp:TextBox>

            </div>

            <asp:Button Text="确定" runat="server" ID="submitEditLanMu" οnclick="submitEditLanMu_Click" />

            <asp:Button ID="backtolanmu" runat="server" Text="返回" οnclick="back_Click" />

        </div>

    </div>

    </form>

</body>

</html>

 

栏目管理(lanmuManage.aspx):

<html xmlns="http://www.w3.org/1999/xhtml">

<head runat="server">

    <title></title>

    <link href="../css/style.css" rel="stylesheet" type="text/css" />

    <style type="text/css">

        body{ background-image:url('backgroundimgs/bg003.jpg');background-size: cover;}

        #addLanMu,#backtomanage

        {

            color:White;

            width:100px;

            height: 35px;

        outline: none;

        margin:10px 50px;

        border: none;

        

        line-height: 35px;

        border-radius: 50px;

        position: relative;

        border: rgba(255,255,255,0.2) 2px solid ;

        color: var(--color);

            -webkit-transition: 0.25s;

            transition: 0.25s;

        }

        #addLanMu {box-shadow: 0.3em 0.3em 0 0 var(--color), inset 0.3em 0.3em 0 0 var(--color);}

        #addLanMu:hover, #addLanMu:focus {box-shadow: 0 0 0 0 var(--hover), inset 6em 3.5em 0 0 var(--hover);}

        #addLanMu {--color: #19bc8b;--hover: #1973bc;}

        #backtomanage:hover,#backtomanage:focus{box-shadow: inset 0 -3.25em 0 0 var(--hover);}

        #backtomanage{  --color: #000000;  --hover: #94e458;}

    </style>

</head>

<body>

    <form id="form1" runat="server">

        <div id="addLanMuHeader" style=" height:50px; border:0">

            <div style="float:left">

                <asp:Label ID="bigUser" runat="server"></asp:Label>

            </div>

            <div style="float:right">

                <asp:Button ID="addLanMu" runat="server" Text="添加栏目" οnclick="addLanMu_Click" />

            </div>

        </div>

        <div id="showLanMu">

            <div>

                <asp:GridView ID="gvLanMu" runat="server" AutoGenerateColumns="False" 

                    Width="500px" BorderStyle="None">

                    <Columns>

                        <asp:BoundField DataField="lanMuId" HeaderText="栏目ID">

                        <ItemStyle HorizontalAlign="Center" Width="100px" BorderStyle="None" />

                        </asp:BoundField>

                        <asp:BoundField DataField="lanMuName" HeaderText="栏目名称">

                        <ItemStyle HorizontalAlign="Center" Width="100px" BorderStyle="None" />

                        </asp:BoundField>

                        <asp:TemplateField HeaderText="修改">

                            <ItemTemplate>

                                <asp:LinkButton ID="editLanMu" runat="server" οnclick="editLanMu_Click">编辑栏目</asp:LinkButton>

                                  

                                <asp:LinkButton ID="delLanMu" runat="server" οnclick="delLanMu_Click">删除</asp:LinkButton>

                            </ItemTemplate>

                            <ItemStyle HorizontalAlign="Center" Width="150px" BorderStyle="None" />

                        </asp:TemplateField>

                        <asp:TemplateField HeaderText="管理">

                            <ItemTemplate>

                                <asp:LinkButton ID="setManage" runat="server" οnclick="setManage_Click">设置管理员</asp:LinkButton>

                            </ItemTemplate>

                            <ItemStyle HorizontalAlign="Center" Width="100px" BorderStyle="None" />

                        </asp:TemplateField>

                    </Columns>

                </asp:GridView>

            </div>

    </div>

        <asp:Button ID="backtomanage" runat="server" οnclick="backtomanage_Click" Text="返回" style=" float:right; position:absolute; right:110px" />

    </form>

    <div id="backfooter">

        <div >

                版权所有:@ 2018 姚锋 地址:江苏省常熟市南三环路99号 <br />

                联系电话:188xxxxxxxx 邮政编码:215500 <br />

            [<a href="yf/index.aspx" target="_blank">后台管理</a>]

        </div>

    </div>

</body>

</html>

5.1.2用户部分

添加用户(addUsers.aspx):

<html xmlns="http://www.w3.org/1999/xhtml">

<head runat="server">

    <title></title>

    <link href="../css/style.css" rel="stylesheet" type="text/css" />

    <style type="text/css">

       html,body {padding:0;margin:0}

       canvas { display:block}

    </style>

</head>

<body>

    <form id="form1" runat="server">

    <div>

        <div id="addUserDiv">

            <div style=" text-align:center; color:White; ">增加用户</div>

            <div class="addUserClass">

                <img src="loginimages/user_icon_copy.png" />

                <asp:TextBox ID="addUserName" runat="server" style="width:150px;  border:0px; color: White;"></asp:TextBox>

            </div>

            <br />

            <div class="addUserClass">

                <img src="loginimages/lock_icon_copy.png" />

                 <asp:TextBox ID="addUserPwd" runat="server" style="width:150px; border:0px; color: White;"></asp:TextBox>

            </div>

            <div class="mb2">

                <asp:Button  Text="确定¨" runat="server" ID="submitUser" οnclick="submitUser_Click" />

            </div>

            <div class="mb2">

                <asp:Button ID="back" runat="server" οnclick="back_Click" Text="返回" />

            </div>

        </div>

    </div>

    </form>

    <canvas></canvas>

    <script src="loginJavascript/hailang.js" type="text/javascript"></script>

</body>

</html>

编辑用户(editUsers.aspx):

<html xmlns="http://www.w3.org/1999/xhtml">

<head runat="server">

    <title></title>

    <link href="../css/style.css" rel="stylesheet" type="text/css" />

    <style type="text/css">

         body{ background-image:url('backgroundimgs/bg003.jpg');background-size: cover;}

         #backto,#submitEditUser

         {

              margin: 30px 20px;

              padding: 15px 20px;

              border-radius: 10px;

              border: 2px solid;

              font: 16px 'Open Sans', sans-serif;

              text-transform: uppercase;

              background: none;

              outline: none;

              cursor: pointer;

              -webkit-transition: all .5s;

              transition: all .5s;

          }

          #submitEditUser {

              color: #A3F7BF;

              border-color: #A3F7BF;

              background: -webkit-linear-gradient(left, #a3f7bf, #a3f7bf) no-repeat;

              background: linear-gradient(to right, #a3f7bf, #a3f7bf) no-repeat;

              background-size: 0% 100%;

            }

          #submitEditUser:hover {background-size: 100% 100%; color: #27323A;}

          #backto {color: #E4F68F;

              border-color: #E4F68F;

              background: -webkit-linear-gradient(left, #e4f68f, #e4f68f) no-repeat;

              background: linear-gradient(to right, #e4f68f, #e4f68f) no-repeat;

              background-size: 100% 0%;

            }

          #backto:hover {background-size: 100% 100%; color: #27323A;}

    </style>

</head>

<body>

    <form id="form1" runat="server">

    <div>

         <div id="editUserDiv">

            <div style=" text-align:center; color:White;">编辑用户</div>

            <div class="addUserClass">

                <img src="loginimages/user_icon_copy.png" />

                <asp:TextBox ID="editUserName" runat="server" style="width:150px;  border:0px"></asp:TextBox>

            </div>

            <br />

            <div class="addUserClass">

                <img src="loginimages/lock_icon_copy.png" />

                <asp:TextBox ID="editUserPwd" runat="server" style="width:150px;  border:0px"></asp:TextBox>

            </div>

            <asp:Button Text="确定¨" runat="server" ID="submitEditUser" οnclick="submitEditUser_Click"/>

            <asp:Button ID="backto" runat="server" οnclick="back_Click" Text="返回" />

        </div>

    </div>

    </form>

</body>

</html>

管理用户(userManage.aspx):

<html xmlns="http://www.w3.org/1999/xhtml">

<head runat="server">

    <title>用户管理系统</title>

    <link href="../css/style.css" rel="stylesheet" type="text/css" />

    <style type="text/css">

        body{ background-image:url('backgroundimgs/bg003.jpg'); background-size: cover;}

        #Button1

        {

           color:White;

            width:100px;

            height: 35px;

        outline: none;

        margin:10px 50px;

        border: none;

        

        line-height: 35px;

        border-radius: 50px;

        position: relative;

        border: rgba(255,255,255,0.2) 2px solid ;

        color: var(--color);

            -webkit-transition: 0.25s;

            transition: 0.25s;

        }

        #Button1:hover,#Button1:focus {box-shadow: inset 6.5em 0 0 0 var(--hover);}

        #Button1 {--color: #8fc866;--hover: #66c887;}

        #back:hover{ color:Black; ">    </style>

</head>

<body>

    <form id="form1" runat="server">

    <div>

        <div id="addUserHeader" style=" height:50px; border:0">

            <div style="float:left">

                <asp:Label ID="bigUser" runat="server" style=" color:White;"></asp:Label>

            </div>

            <div style="float:right">

                <asp:Button ID="Button1" runat="server" οnclick="Button1_Click" Text="添加用户" />

            </div>

        </div>

    </div>

    <div id="showUser">

            <asp:GridView ID="gvUser" runat="server" AutoGenerateColumns="False" 

        Width="1000px" BorderStyle="None"  >

        <Columns>

            <asp:BoundField DataField="uid" HeaderText="用户编号">

            <ItemStyle HorizontalAlign="Center" Width="100px" BorderStyle="None" />

            </asp:BoundField>

            <asp:HyperLinkField DataNavigateUrlFields="uid" DataTextField="userName" 

                HeaderText="用户姓名">

            <ItemStyle HorizontalAlign="Center" Width="100px" BorderStyle="None" />

            </asp:HyperLinkField>

            <asp:BoundField DataField="passWord" HeaderText="用户密码">

            <ItemStyle HorizontalAlign="Center" Width="100px" BorderStyle="None" />

            </asp:BoundField>

            <asp:TemplateField HeaderText="修改">

                <ItemTemplate>  

                    <asp:LinkButton ID="editUser" runat="server" οnclick="editUser_Click">编辑用户</asp:LinkButton>

                      

                    <asp:LinkButton ID="deleteUser" runat="server" οnclick="deleteUser_Click">删除</asp:LinkButton>

                </ItemTemplate>

                <ItemStyle Width="200px" HorizontalAlign="Center" BorderStyle="None" />

            </asp:TemplateField>

        </Columns>

    </asp:GridView>

    </div>

    <asp:Button ID="back" runat="server" οnclick="back_Click" Text="返回" style=" position:absolute; right:50px;"/>

    </form>

    <div id="backfooter">

        <div >

                版权所有:@ 2018 姚锋 地址:江苏省常熟市南三环路99号 <br />

                联系电话:188xxxxxxxx 邮政编码:215500 <br />

            [<a href="yf/index.aspx" target="_blank">后台管理</a>]

        </div>

    </div>

</body>

</html>

5.1.3新闻部分

添加新闻(addNews.aspx):

<html xmlns="http://www.w3.org/1999/xhtml">

<head runat="server">

    <title>发布信息页面</title>

    <style type="text/css">

         body{ background-image:url('backgroundimgs/bg003.jpg');background-size: cover;}

    </style>

    <link href="../css/style.css" rel="stylesheet" type="text/css" />

     <link rel="stylesheet" href="kde/themes/default/default.css" />

<link rel="stylesheet" href="kde/plugins/code/prettify.css" />

<script charset="utf-8" src="kde/kindeditor.js"></script>

<script charset="utf-8" src="kde/lang/zh_CN.js"></script>

<script charset="utf-8" src="kde/plugins/code/prettify.js"></script>

<script>

    KindEditor.ready(function (K) {

        var editor1 = K.create('#content1', {

            cssPath: 'kde/plugins/code/prettify.css',

            uploadJson: 'kde/upload_json.ashx',

            fileManagerJson: 'kde/file_manager_json.ashx',

            allowFileManager: true,

            afterCreate: function () {

                var self = this;

                K.ctrl(document, 13, function () {

                    self.sync();

                    K('form[name=example]')[0].submit();

                });

                K.ctrl(self.edit.doc, 13, function () {

                    self.sync();

                    K('form[name=example]')[0].submit();

                });

            }

        });

        prettyPrint();

    });

</script>

</head>

<body>

    <form id="example" runat="server">

    <div id="box">

        <div style="width:1000px;margin:10px 0;border:1px #ccc solid;">标题:<asp:TextBox 

                ID="txtTitle" runat="server"></asp:TextBox>

        </div>

        <div style="width:1000px;margin:10px 0;border:1px #ccc solid;">栏目:<asp:DropDownList 

                ID="ddlLanMu" runat="server">

            </asp:DropDownList>

          主页图片:<asp:TextBox ID="txtImgUrl" runat="server" Width="495px"></asp:TextBox>

        </div>

        <div style="width:1000px;margin:10px 0;border:1px #ccc solid;">

            <textarea id="content1" cols="100" rows="8" style="width:1000px;height:500px;visibility:hidden;" runat="server"></textarea>

            <br />

            <asp:Button ID="btnBack" runat="server" οnclick="btnBack_Click" Text="返回" />

 <asp:Button ID="btnSubmit" runat="server" Text="提交内容" 

                οnclick="btnSubmit_Click" /> (提交快捷键: Ctrl + Enter)

        </div>

    </div>

    </form>

</body>

</html>

编辑新闻(editNews.aspx):

<html xmlns="http://www.w3.org/1999/xhtml">

<head id="Head1" runat="server">

    <title>编辑新闻页面</title>

    <link href="../css/style.css" rel="stylesheet" type="text/css" />

     <link rel="stylesheet" href="kde/themes/default/default.css" />

<link rel="stylesheet" href="kde/plugins/code/prettify.css" />

<script charset="utf-8" src="kde/kindeditor.js"></script>

<script charset="utf-8" src="kde/lang/zh_CN.js"></script>

<script charset="utf-8" src="kde/plugins/code/prettify.js"></script>

<script>

    KindEditor.ready(function (K) {

        var editor1 = K.create('#content1', {

            cssPath: 'kde/plugins/code/prettify.css',

            uploadJson: 'kde/upload_json.ashx',

            fileManagerJson: 'kde/file_manager_json.ashx',

            allowFileManager: true,

            afterCreate: function () {

                var self = this;

                K.ctrl(document, 13, function () {

                    self.sync();

                    K('form[name=example]')[0].submit();

                });

                K.ctrl(self.edit.doc, 13, function () {

                    self.sync();

                    K('form[name=example]')[0].submit();

                });

            }

        });

        prettyPrint();

    });

</script>

</head>

<body>

    <form id="example" runat="server">

    <div id="box">

        <div style="width:1000px;margin:10px 0;border:1px #ccc solid;">标题:<asp:TextBox 

                ID="txtTitle" runat="server"></asp:TextBox>

        </div>

        <div style="width:1000px;margin:10px 0;border:1px #ccc solid;">栏目:<asp:DropDownList 

                ID="ddlLanMu" runat="server">

            </asp:DropDownList>

          主页图片:<asp:TextBox ID="txtImgUrl" runat="server" Width="475px"></asp:TextBox>

        </div>

        <div style="width:1000px;margin:10px 0;border:1px #ccc solid;">

            <textarea id="content1" cols="100" rows="8" style="width:1000px;height:500px;visibility:hidden;" runat="server"></textarea>

            <br />

            <asp:Button ID="btnCancel" runat="server" οnclick="btnCancel_Click" Text="返回" />

 <asp:Button ID="btnEdit" runat="server" Text="提交内容" οnclick="btnEdit_Click" /> (提交快捷键: Ctrl + Enter)

        </div>

    </div>

    </form>

</body>

</html>

 

给新闻设置管理员:(setManage.aspx

<html xmlns="http://www.w3.org/1999/xhtml">

<head runat="server">

    <title></title>

    <link href="../css/style.css" rel="stylesheet" type="text/css" />

    <style type="text/css">

            body{ background-image:url('backgroundimgs/bg003.jpg');}

            #setManage,#backTo

            {

              margin : 30px 20px;

              padding: 15px 20px;

              border-radius: 10px;

              border: 2px solid;

              font: 16px 'Open Sans', sans-serif;

              text-transform: uppercase;

              background: none;

              outline: none;

              cursor: pointer;

              -webkit-transition: all .5s;

              transition: all .5s;}

               #setManage  {color: #A3F7BF;

              border-color: #A3F7BF;

              background: -webkit-linear-gradient(left, #a3f7bf, #a3f7bf) no-repeat;

              background: linear-gradient(to right, #a3f7bf, #a3f7bf) no-repeat;

              background-size: 0% 100%;}

             #setManage:hover {background-size: 100% 100%; color: #27323A;}

             #backTo{color: #E4F68F;

              border-color: #E4F68F;

              background: -webkit-linear-gradient(left, #e4f68f, #e4f68f) no-repeat;

              background: linear-gradient(to right, #e4f68f, #e4f68f) no-repeat;

              background-size: 100% 0%;}

             #backTo:hover,#backTo:focus {background-size: 100% 100%; color: #27323A;}            

    </style>

</head>

<body>

    <form id="form1" runat="server">

    <div>

        <div id="manageList">

             <div style=" text-align:center; color:White;">设置管理员</div></br>

             <asp:DropDownList ID="userList" runat="server" style="width:100px; height:30px ">

             </asp:DropDownList>

             </br>

             <asp:Button ID="setManage" runat="server" οnclick="setManage_Click" Text="确认" />

             <asp:Button ID="backTo" runat="server" οnclick="back_Click" Text="返回" />

        </div>

    </div>

    </form>

    <div id="backfooter">

        <div >

                版权所有:@ 2018 姚锋 地址:江苏省常熟市南三环路99号 <br />

                联系电话:188xxxxxxxx 邮政编码:215500 <br />

            [<a href="yf/index.aspx" target="_blank">后台管理</a>]

        </div>

    </div>

</body>

</html>

 

新闻搜索(Search.aspx):

<html xmlns="http://www.w3.org/1999/xhtml">

<head runat="server">

    <title></title>

    <link href="css/style.css" rel="stylesheet" type="text/css" />

</head>

<body>

    <form id="form1" runat="server">

    <div>

        <div id="box">

        <div id="header"></div>

        <div class="splitDiv"></div>

        <div id="showLanmu">

             <%=Lanmu.getLanMu()%>

        </div>

        <div class="splitDiv"></div>

        <div id="main">

            <div id="left" style="width:400px;">

                

                <asp:GridView ID="SearchHotNews" runat="server" AutoGenerateColumns="False" 

                    ShowHeader="False" BorderStyle="None" CellPadding="0" GridLines ="None" 

                    Width="400px">

                    <Columns>

                        <asp:HyperLinkField 

                            DataNavigateUrlFormatString="showNews.aspx?id={0}" DataTextField="title" 

                            DataNavigateUrlFields="newid" Target="_blank">

                        <ItemStyle Width="420px" />

                        </asp:HyperLinkField>

                        <asp:BoundField DataField="hitCount" HeaderText="点击量">

                        <ItemStyle HorizontalAlign="Center" Width="50px" />

                        </asp:BoundField>

                        <asp:BoundField DataField="addTime" DataFormatString="{0:[yy-MM-dd]}" 

                            HeaderText="发布时间?">

                        <ItemStyle Width="120px" HorizontalAlign="Center" />

                        </asp:BoundField>

                    </Columns>

                </asp:GridView>

            </div>

            <div id="right" style="width:580px;">

                <asp:GridView ID="SearchNews" runat="server" AutoGenerateColumns="False" 

                    ShowHeader="False" BorderStyle="None" CellPadding="0" GridLines ="None" 

                    Width="580px">

                    <Columns>

                        <asp:HyperLinkField 

                            DataNavigateUrlFormatString="showNews.aspx?id={0}" DataTextField="title" 

                            DataNavigateUrlFields="newid" Target="_blank">

                        <ItemStyle Width="420px" />

                        </asp:HyperLinkField>

                        <asp:BoundField DataField="addTime" DataFormatString="{0:[yy-MM-dd]}">

                        <ItemStyle Width="100px" HorizontalAlign="Center" />

                        </asp:BoundField>

                    </Columns>

                </asp:GridView>

            </div>

        <div class="splitDiv"></div>

        <div id="divLinks">友情链接</div>

        <span id="QLinks">

              <ul style=" border:1px solid #ccc;  margin-top:10px; height:70px">

                <li><a href='http://rsc.cslg.cn/rsc/' target='_blank'><img src="yf/backgroundimgs/rsc.jpg"  border='0' width='106px' height='46px'></a></li>

                <li><a href='http://www.hep.com.cn/service/xuanshu' target='_blank'><img src='yf/backgroundimgs/gdjycbs.jpg' border='0' width='106px' height='46px'></a></li>

                <li><a href='http://kjc.cslg.edu.cn/' target='_blank'><img src='yf/backgroundimgs/kxjs.jpg' border='0' width='106px' height='46px'></a></li>

                <li><a href='http://jwc.cslg.cn/jwc/' target='_blank'><img src='yf/backgroundimgs/jwc.jpg' border='0' width='106px' height='46px'></a></li>

                <li><a href='http://www.icourses.cn/' target='_blank'><img src='yf/backgroundimgs/akc.jpg' border='0' width='106px' height='46px'></a></li>

                <li><a href='http://ctl.nju.edu.cn/yanjiuhui/' target='_blank'><img src='yf/backgroundimgs/jsgx.jpg' border='0' width='106px' height='46px'></a></li>

              </ul>

         </span>

         <div class="splitDiv"></div>

        <a href="#top"><img src="images/backTop.png" alt="Alternate Text" id="backTop" title="回到顶部" /></a>

        <div id="footer">

        <div >

                版权所有:@ 2018 姚锋 地址:江苏省常熟市南三环路99号 <br />

                联系电话:188xxxxxxxx 邮政编括码:215500 <br />

            [<a href="yf/index.aspx" target="_blank">后台管理</a>]

        </div>

    </div>

    </form>

</body>

</html>

 

菜单栏目新闻(showlist.aspx):

<html xmlns="http://www.w3.org/1999/xhtml">

<head runat="server">

    <title></title>

    <link href="css/style.css" rel="stylesheet" type="text/css" />

    <style type="text/css">

        #sure{color:White;

            width:100px;

            height: 43px;

        outline: none;

        border: none;

        line-height: 43px;

        border-radius: 50px;

        position: relative;

        border: rgba(255,255,255,0.2) 2px solid ;

        color: var(--color);

            -webkit-transition: 0.25s;

            transition: 0.25s;

            }

        #sure:hover,#sure:focus {-webkit-animation: pulse 1s;animation: pulse 1s;box-shadow: 0 0 0 2em rgba(255, 255, 255, 0);}

        #sure {--color: #ef6eae;--hover: #ef8f6e;}

        @-webkit-keyframes pulse {0% {box-shadow: 0 0 0 0 var(--hover);}}

        @keyframes pulse {0% {box-shadow: 0 0 0 0 var(--hover);}}

      </style>

</head>

<body>

    <form id="form1" runat="server">

    <div>

        <div id="box">

        <div id="header"></div>

        <div class="splitDiv"></div>

        <div id="showLanmu">

             <%=Lanmu.getLanMu()%>

             <asp:Button ID="sure" runat="server" Text="搜索" />

             <asp:TextBox ID="Search" runat="server"  style="width:200px; border:1px solid  black; border-radius: 50px; text-align:center"></asp:TextBox>

        </div>

        <div class="splitDiv"></div>

        <div id="main">

            <div id="left" style="width:400px; ">

                <asp:GridView ID="gvHotNews" runat="server" AutoGenerateColumns="False" 

                    ShowHeader="False" BorderStyle="None" CellPadding="0" GridLines ="None" 

                    Width="400px">

                    <Columns>

                        <asp:HyperLinkField 

                            DataNavigateUrlFormatString="showNews.aspx?id={0}" DataTextField="title" 

                            DataNavigateUrlFields="newid" Target="_blank">

                        <ItemStyle Width="420px" />

                        </asp:HyperLinkField>

                        <asp:BoundField DataField="hitCount" HeaderText="点击量">

                        <ItemStyle HorizontalAlign="Center" Width="50px" />

                        </asp:BoundField>

                        <asp:BoundField DataField="addTime" DataFormatString="{0:[yy-MM-dd]}" 

                            HeaderText="发布时间?">

                        <ItemStyle Width="120px" HorizontalAlign="Center" />

                        </asp:BoundField>

                    </Columns>

                </asp:GridView>

            </div>

            <div id="right" style="width:580px; ">

                <asp:GridView ID="gvNews" runat="server" AutoGenerateColumns="False" 

                    ShowHeader="False" BorderStyle="None" CellPadding="0" GridLines ="None" 

                    Width="580px">

                    <Columns>

                        <asp:HyperLinkField 

                            DataNavigateUrlFormatString="showNews.aspx?id={0}" DataTextField="title" 

                            DataNavigateUrlFields="newid" Target="_blank">

                        <ItemStyle Width="420px" />

                        </asp:HyperLinkField>

                        <asp:BoundField DataField="addTime" DataFormatString="{0:[yy-MM-dd]}">

                        <ItemStyle Width="100px" HorizontalAlign="Center" />

                        </asp:BoundField>

                    </Columns>

                </asp:GridView>

            </div>

        <div class="splitDiv"></div>

        <div id="divLinks">友情链接</div>

        <span id="QLinks">

              <ul style=" border:1px solid #ccc;  margin-top:10px; height:70px">

                <li><a href='http://rsc.cslg.cn/rsc/' target='_blank'><img src="yf/backgroundimgs/rsc.jpg"  border='0' width='106px' height='46px'></a></li>

                <li><a href='http://www.hep.com.cn/service/xuanshu' target='_blank'><img src='yf/backgroundimgs/gdjycbs.jpg' border='0' width='106px' height='46px'></a></li>

                <li><a href='http://kjc.cslg.edu.cn/' target='_blank'><img src='yf/backgroundimgs/kxjs.jpg' border='0' width='106px' height='46px'></a></li>

                <li><a href='http://jwc.cslg.cn/jwc/' target='_blank'><img src='yf/backgroundimgs/jwc.jpg' border='0' width='106px' height='46px'></a></li>

                <li><a href='http://www.icourses.cn/' target='_blank'><img src='yf/backgroundimgs/akc.jpg' border='0' width='106px' height='46px'></a></li>

                <li><a href='http://ctl.nju.edu.cn/yanjiuhui/' target='_blank'><img src='yf/backgroundimgs/jsgx.jpg' border='0' width='106px' height='46px'></a></li>

              </ul>

         </span>

         <div class="splitDiv"></div>

           

        <a href="#top"><img src="images/backTop.png" alt="Alternate Text" id="backTop" title="回到顶部" /></a>

        <div id="footer">

        <div >

                版权所有:@ 2018 姚锋 地址:江苏省常熟市南三环路99号 <br />

                联系电话:188xxxxxxxx 邮政编括码:215500 <br />

            [<a href="yf/index.aspx" target="_blank">后台管理</a>]

        </div>

    </div>

    </form>

</body>

</html>

 

单篇新闻(shownews.aspx:

<html xmlns="http://www.w3.org/1999/xhtml">

<head runat="server">

    <title>查看新闻页面</title>

    <link href="css/style.css" rel="stylesheet" type="text/css" />

    <style type="text/css">

        #shownewssure{color:White;

            width:100px;

            height: 43px;

        outline: none;

        line-height: 43px;

        border-radius: 50px;

        border:  1px solid #000;

        position: relative;

        border: rgba(255,255,255,0.2) 2px solid ;

        color: var(--color);

            -webkit-transition: 0.25s;

            transition: 0.25s;

            }

        #shownewssure:hover,#shownewssure:focus {-webkit-animation: pulse 1s;animation: pulse 1s;box-shadow: 0 0 0 2em rgba(255, 255, 255, 0);}

        #shownewssure {--color: #ef6eae;--hover: #ef8f6e;}

        @-webkit-keyframes pulse {0% {box-shadow: 0 0 0 0 var(--hover);}}

        @keyframes pulse {0% {box-shadow: 0 0 0 0 var(--hover);}}

    </style>

</head>

<body>

    <form id="form1" runat="server">

   <div id="box">

        <div id="header"></div>

        <div class="splitDiv"></div>

        <div id="showLanmu">

            <div id="lanMuList" >

                <%=Lanmu.getLanMu()%>

                <asp:Button ID="shownewssure" runat="server" Text="搜索" 

                    οnclick="shownewssure_Click" />

                <asp:TextBox ID="shownewsSearch" runat="server" style="width:200px; border:1px solid  black; border-radius: 50px; text-align:center"></asp:TextBox>

                 

            </div>

        </div>

        <div class="splitDiv"></div>

 

        <div id="main">

            <div id="newsTitle">

                <asp:Label ID="lblTitle" runat="server"></asp:Label>

            </div>

            <div class="line"></div>

            <div id="newsInfo">

                <asp:Label ID="lblAddTime" runat="server"></asp:Label>

        

                <asp:Label ID="lblHitCount" runat="server"></asp:Label>

           

                <asp:Label ID="lblAuthor" runat="server"></asp:Label>

            </div>

            <div id="newsContent">

                <asp:Label ID="lblContent" runat="server"></asp:Label>

            </div>

        <div class="splitDiv"></div>

        <div id="divLinks">友情链接</div>

        <span id="QLinks">

              <ul style=" border:1px solid #ccc;  margin-top:10px; height:70px">

                <li><a href='http://rsc.cslg.cn/rsc/' target='_blank'><img src="yf/backgroundimgs/rsc.jpg"  border='0' width='106px' height='46px'></a></li>

                <li><a href='http://www.hep.com.cn/service/xuanshu' target='_blank'><img src='yf/backgroundimgs/gdjycbs.jpg' border='0' width='106px' height='46px'></a></li>

                <li><a href='http://kjc.cslg.edu.cn/' target='_blank'><img src='yf/backgroundimgs/kxjs.jpg' border='0' width='106px' height='46px'></a></li>

                <li><a href='http://jwc.cslg.cn/jwc/' target='_blank'><img src='yf/backgroundimgs/jwc.jpg' border='0' width='106px' height='46px'></a></li>

                <li><a href='http://www.icourses.cn/' target='_blank'><img src='yf/backgroundimgs/akc.jpg' border='0' width='106px' height='46px'></a></li>

                <li><a href='http://ctl.nju.edu.cn/yanjiuhui/' target='_blank'><img src='yf/backgroundimgs/jsgx.jpg' border='0' width='106px' height='46px'></a></li>

              </ul>

         </span>

         <div class="splitDiv"></div>

        <a href="#top"><img src="images/backTop.png" alt="Alternate Text" id="backTop" title="回到顶部" /></a>

        <div id="footer">

        <div >

                版权所有:@ 2018 姚锋地址:江苏省常熟市南三环路99号<br />

                联系电话:188xxxxxxxx 邮政编码:215500 <br />

            [<a href="yf/index.aspx" target="_blank">后台管理</a>]

        </div>

    </div>

    </form>

</body>

</html>

5.1.4 主要CSS样式部分

*,td,li,ul,body {margin:0;padding:0; }

td,th,table{ border:o;}

#box{width:1000px;margin:0 auto;}

#header{width:1000px;height:170px; background-image:url(../images/toppic.jpg);}

#main{width:1000px;}

#left{float:left;width:490px;height:300px;}

#right{float:right;width:500px;}

.splitDiv{ height:10px; clear:both;}

.line{ width:1000px; height:1px; background:#000; margin:10px 0;}

#divLeft,#divMiddle,#divRight{width:320px;height:200px;float:left;}

#divRight{margin: 10px 10px 10px 0px;  }

#divMiddle{ margin:10px 10px 10px 0px;}

#divLeft{ margin:10px 10px 10px 0px;}

#divLinks{ width:990px; border:1px solid #ccc; padding:5px;}

#footer{ width:1000px; text-align:center;   font-size:14px; }

#backfooter{  width:100%; text-align:center;  background-color:#20B2AA; font-size:14px; position:fixed; bottom:0px}

.smallTitle{ text-align:center;}

#backTop{ position:fixed; right:20px; bottom:15px;height: 154px;}

#lanMuList{ height:30px; width:1000px; }

#lanMuList li{ list-style:none; float:left; margin: 0 5px 0px 0px; width:60px; height:40px; line-height:40px;  text-align:center; }

#lanMuList a{ text-decoration: none; color:White; font-weight:bold;}

#lanMuList li:hover{ }

/*下面为showlist界面导航css样式*/

#showLanmu a:hover{ color:Red;}

#showLanmu{ height:30px; width:1000px; }

#showLanmu li{ list-style:none; float:left; margin: 0 5px 0px 0px; width:60px; height:40px; line-height:40px;  text-align:center; }

#showLanmu a{ text-decoration: none; color:White; font-weight:bold;}

#showLanmu li:hover{ }

#showLanmu a:hover{ color:Red;}

/*下面为搜索框及按钮css样式*/

#sure,#shownewssure{ float:right; height:35px; width:50px;}

#Search,#shownewsSearch{ float:right; width:200px; height:30px; }

#QLinks ul li{ list-style-type:none;float:left; height:60px; width:157px; margin:8px 0 0 8px; *display:inline; overflow:hidden;}

#QLinks ul li img{ width:149px; height:52px; padding:3px; border:1px solid #e6e6e6;}

 /*下面是登陆界面的css样式表*/

#userlogin{width:150px;height:90px;position:absolute;

     left:50%;top:50%;

     border:1px red solid;

     margin-left:-75px;

     margin-top:-45px;}

 /*下面是查看新闻内容页面的样式表*/

#newsTitle{width:1000px;text-align:center;font-size:18pt;}

#newsContent{width:1000px;font-size:12pt;}

#newsInfo{ width:1000px; font-size:12pt; text-align:center; margin-bottom:10px;}

/*下面是管理页面布局样式表*/

#adminHeader{ line-height:25px; height:25px; width:1000px; margin-top:5px;}

#adminMenu{line-height:25px;height:25px;width:1000px;}

#adminContent{width:1000px;}

/*下面是用户管理界面样式表*/

#showUser{ width:1000px; margin:0 auto;}

/*下面是增加用户样式表*/

#addUserDiv 

{width:250px; position:absolute; top:50%;left:50%;  text-align:center;

 box-shadow: -15px 15px 15px rgba(6, 17, 47, 0.7);opacity: 1;top: 20px;

 position: relative;width: 300px;height: 400px;position: absolute;

 left: 0;right: 0;margin: auto;top: 0;bottom: 0;padding: 100px 40px 40px 40px;

 background: #35394a;

 /* Old browsers */

 /* FF3.6+ */

 background: -webkit-gradient(linear, left bottom, right top, color-stop(0%, #35394a), color-stop(100%, rgb(0, 0, 0)));

 /* Chrome,Safari4+ */

 background: -webkit-linear-gradient(230deg, rgba(53, 57, 74, 0) 0%, rgb(0, 0, 0) 100%);

 /* Chrome10+,Safari5.1+ */

 /* Opera 11.10+ */

 /* IE10+ */

 background: linear-gradient(230deg, rgba(53, 57, 74, 0) 0%, rgb(0, 0, 0) 100%);

 /* W3C */

 filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='rgba(53, 57, 74, 0)', endColorstr='rgb(0, 0, 0)',GradientType=1 );

 /* IE6-9 fallback on horizontal gradient */}

.addUserClass 

{margin:20px;color:White;height: 46px;outline: none;margin-left: 50px;border: none;line-height: 46px;height: 46px;padding: 0 5px;margin-bottom: 20px;border-radius: 50px;position: relative;border: rgba(255,255,255,0.2) 2px solid ;}

.mb2 #back,#submitUser{text-decoration: none;outline: none;}

#back,#submitUser {padding: 15px;margin-left:30px;float:left;display: block;line-height: 20px;text-align: center;font-size: 20px;border-radius: 50px;background:  rgba(0,0,0,0);border:1px solid #75faff;width:100px;color:#75faff;}

#addUserName,#addUserPwd,#editUserName,#editUserPwd,#editLanMu,#addLanMuName,#Search,#shownewsSearch{height: 40px;outline: none;margin-left: 20px;border: none;line-height: 40px;color: black;}

#addUserHeader{line-height:25px; height:25px; width:1000px; margin:5px auto; border:1px solid #ccc;}

/*下面是编辑用户样式表*/

#editUserDiv{ width:250px; position:absolute; top:50%;left:50%; margin-left:-155px; margin-top:-200px; text-align:center; background: rgba(41, 39, 39, 0.46);-webkit-box-shadow: 0px 35px 44px -22px rgba(0,0,0,0.72);-moz-box-shadow: 0px 35px 44px -22px rgba(0,0,0,0.72);box-shadow: 0px 35px 44px -22px #1f181b;padding: 60px 40px; }

.addUserClass{ margin:20px;}

#eidtUserHeader{line-height:25px; height:25px; width:1000px; margin:5px auto; border:1px solid #ccc;}

/*下面是栏目管理界面样式表*/

#showLanMu{ width:1000px; margin:0 auto;}

#addLanMuHeader{line-height:25px; height:25px; width:1000px; margin:5px auto; border:1px solid #ccc;}

#editLanMuDiv,#addLanMuDiv,#manageList{width:300px; position:absolute; top:50%;left:50%; margin-left:-155px; margin-top:-200px;

              text-align:center; background: rgba(41, 39, 39, 0.46);

              -webkit-box-shadow: 0px 35px 44px -22px rgba(0,0,0,0.72);-moz-box-shadow: 0px 35px 44px -22px rgba(0,0,0,0.72);

              box-shadow: 0px 35px 44px -22px #1f181b;

              padding: 60px 40px;}

 

5.2后台部分主要代码

5.2.1数据库部分

Sqlhelper类:

public class sqlhelper

{

public sqlhelper()

{

}

    /// <summary>

    /// 函数实现建数据库连接,并返回该连接

    /// </summary>

    /// <returns>返回建立好的数据库连接</returns>

    public static SqlConnection createCon()

    {

        //获取配置文件中设置好的连接

        SqlConnection con = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["myCon"].ConnectionString);

        return con;

    }

    public static void excuteSql(string sqlString)

    {

        SqlConnection con = createCon();

        con.Open();

        SqlCommand cmd = new SqlCommand(sqlString, con);

        cmd.ExecuteNonQuery();

        con.Close();

    }

    /// <summary>

    /// 数据检索

    /// </summary>

    /// <param name="sqlString"></param>

    /// <returns></returns>

    public static DataSet excuteDataSet(string sqlString)

    {

        SqlConnection con = createCon();

        con.Open();

        SqlDataAdapter sda = new SqlDataAdapter(sqlString, con);

        DataSet ds = new DataSet();

        sda.Fill(ds);

        con.Close();

        return ds;

    }

    public static int excuteInt(string sqlString)

    {

        SqlConnection con = createCon();

        con.Open();

        SqlCommand cmd = new SqlCommand(sqlString,con);

        int count=0;

        count = Convert.ToInt32(cmd.ExecuteScalar());

        con.Close();

        return count;

    }

    public static bool excuteBool(string sqlString)

    {

        SqlConnection con = createCon();

        con.Open();

        SqlCommand cmd = new SqlCommand(sqlString, con);

        bool result = true;

        try 

        {

            cmd.ExecuteNonQuery();

        }

        catch

        {

            result=false;

        }

        con.Close();

        return result;

    }

    public static SqlDataReader ExcuteSqlDataReader(string sql, SqlParameter[] parms)

    {

        SqlDataReader result = null;

        SqlConnection con = createCon();

        try

        {

            con.Open();

            SqlCommand cmd = new SqlCommand(sql, con);

            if (parms != null)

                cmd.Parameters.AddRange(parms);

            result = cmd.ExecuteReader(CommandBehavior.CloseConnection);

        }

        catch

        { }

        return result;

    }

}

public static News getNewsById(string id)//通过新闻id查找新闻    

{

        News news = new News();

        string sqlString="select * from t_news where newid="+id;

        SqlConnection con = sqlhelper.createCon();

        con.Open();

        SqlCommand cmd = new SqlCommand(sqlString,con);

        SqlDataReader sdr = cmd.ExecuteReader();

        while (sdr.Read())

        {

            news.newid = Convert.ToInt32(sdr[0]);

            news.title = Convert.ToString(sdr[1]);

            news.contents = Convert.ToString(sdr[2]);

            news.newid = Convert.ToInt32(sdr[3]);

            news.addTime =Convert.ToDateTime(sdr[4]);

            news.lanMuId = Convert.ToInt32(sdr[5]);

            news.hitCount = Convert.ToInt32(sdr[6]);

        }

        con.Close();

        return news;

}

News类:

public class News

{

public News()

{

}

    public int newid;

    public string title;

    public string contents;

    public int uid;

    public DateTime addTime;

    public int lanMuId;

    public int hitCount;

    public string img;

    public static void getPics(ref string pics,ref string texts,ref string links)

    {

        string sqlString = "select top 5 newid,title,img from t_news where img<>'' order by addTime DESC";

        SqlConnection con = sqlhelper.createCon();

        con.Open();

        SqlCommand cmd = new SqlCommand(sqlString, con);

        SqlDataReader sdr = cmd.ExecuteReader();

        while (sdr.Read())

        {

            pics += sdr[2].ToString()+"|";

            texts += sdr[1].ToString() + "|";

            links += "showNews.aspx?id=" +sdr[0].ToString()+ "|";

        }

        pics = pics.Substring(0, pics.Length - 1);

        texts = texts.Substring(0, texts.Length - 1);

        links = links.Substring(0, links.Length - 1);

    }

    public static News getNewsByText(string text)

    {

        News news = new News();

        string sqlString = "select * from news where title like  '%" + text + "%' order by addTime DESC";

        SqlConnection con = sqlhelper.createCon();

        con.Open();

        SqlCommand cmd = new SqlCommand(sqlString, con);

        SqlDataReader sdr = cmd.ExecuteReader();

        while (sdr.Read())

        {

            news.newid = Convert.ToInt32(sdr[0]);

            news.title = Convert.ToString(sdr[1]);

            news.contents = Convert.ToString(sdr[2]);

            news.newid = Convert.ToInt32(sdr[3]);

            news.addTime = Convert.ToDateTime(sdr[4]);

            news.lanMuId = Convert.ToInt32(sdr[5]);

            news.hitCount = Convert.ToInt32(sdr[6]);

        }

        con.Close();

        return news;

    }

    public static News getNewsById(string id)

    {

        News news = new News();

        string sqlString="select * from t_news where newid="+id;

        SqlConnection con = sqlhelper.createCon();

        con.Open();

        SqlCommand cmd = new SqlCommand(sqlString,con);

        SqlDataReader sdr = cmd.ExecuteReader();

        while (sdr.Read())

        {

            news.newid = Convert.ToInt32(sdr[0]);

            news.title = Convert.ToString(sdr[1]);

            news.contents = Convert.ToString(sdr[2]);

            news.newid = Convert.ToInt32(sdr[3]);

            news.addTime =Convert.ToDateTime(sdr[4]);

            news.lanMuId = Convert.ToInt32(sdr[5]);

            news.hitCount = Convert.ToInt32(sdr[6]);

        }

        con.Close();

        return news;

    }

    public static void addHitCount(string id)

    {

        string sqlString = "update t_news set hitCount=hitCount+1 where newid="+id;

        sqlhelper.excuteSql(sqlString);

    }

    public static DataSet getNewsList()

    {

        string sqlString = "select * from View_News order by addTime DESC";

        return sqlhelper.excuteDataSet(sqlString);

    }

    public static DataSet getNewsBymanageId(string id)//管理员管理的页面显示相应栏目的新闻

    {

        string sqlString = "select * from t_user,t_news,t_lanMu where t_user.manageLanmuid=t_news.lanMuId and t_news.lanMuId=t_lanMu.lanMuId and t_user.uid="+id;

        return sqlhelper.excuteDataSet(sqlString);

    }

    public static bool addNews(News n)

    {

        string sqlString = "insert into t_news (title,contents,uid,addTime,lanMuId,hitCount,img) values('"+n.title+"','"+n.contents+"',"+n.uid+",'"+n.addTime+"',"+n.lanMuId+","+n.hitCount+",'"+n.img+"')";

        return sqlhelper.excuteBool(sqlString);

    }

    public static bool editNews(News n)

    {

        string sqlString = "update t_news set title='" + n.title + "', contents='" + n.contents + "', uid=" + n.uid + ", lanMuId=" + n.lanMuId+",img='"+n.img+"' where newid=" +n.newid;

        return sqlhelper.excuteBool(sqlString);

    }

    public static bool delNews(string id)

    {

        string sqlString = "delete from t_news where newid=" + id;

        return sqlhelper.excuteBool(sqlString);

    }

}

Users类:

public class Users

{

public Users()

{

}

    public int uid;

    public string userName;

    public string passWord;

    public int manageLanmuid;

    public static Users getUserById(string id)

    {

        Users users = new Users();

        string sqlString = "select * from t_user where uid=" + id;

        SqlConnection con = sqlhelper.createCon();

        con.Open();

        SqlCommand cmd = new SqlCommand(sqlString, con);

        SqlDataReader sdr = cmd.ExecuteReader();

        while (sdr.Read())

        {

            users.uid = Convert.ToInt32(sdr[0]);

            users.userName = Convert.ToString(sdr[1]);

            users.passWord = Convert.ToString(sdr[2]);

        }

        con.Close();

        return users;

    }

    public static int getuidByName(string userName)

    {

        string sqlString = "select uid from t_user where userName='" + userName + "'";

        SqlConnection con = sqlhelper.createCon();

        con.Open();

        SqlCommand cmd = new SqlCommand(sqlString, con);

        int uid = Convert.ToInt32(cmd.ExecuteScalar());

        con.Close();

        return uid;

    }

    public static DataSet getUserList()//获取用户列表

    {

        string sqlString = "select * from t_user";

        return sqlhelper.excuteDataSet(sqlString);

    }

    public static bool delUser(string id)

    {

        string sqlString = "delete from t_user where uid=" + id;

        return sqlhelper.excuteBool(sqlString);

    }

    public static bool addUser(Users n)

    {

        string sqlString = "insert into t_user (userName,passWord) values('" + n.userName + "','" + n.passWord + "' )";

        return sqlhelper.excuteBool(sqlString);

    }

    public static bool editUser(Users n)

    {

        string sqlString = "update t_user set userName ='" + n.userName + "', passWord='" + n.passWord + "'  where uid=" + n.uid;

        return sqlhelper.excuteBool(sqlString);

    }

    public static bool giveUseraddlanmu(Users n)

    {

        string sqlString = "update t_user set userName ='" + n.userName + "', passWord='" + n.passWord + "', manageLanmuid='" + n.manageLanmuid + "'  where uid=" + n.uid;

        return sqlhelper.excuteBool(sqlString);

    }

}

Lanmu类:

public class Lanmu

{

public Lanmu()

{

}

    public int lanMuId;

    public string lanMuName;

    public static DataSet getLanMuList()//获取用户列表

    {

        string sqlString = "select * from t_lanMu";

        return sqlhelper.excuteDataSet(sqlString);

    }

    public static string getLanMu()//获取动态栏目

    {

        string result = "";

        string sql = "select * from t_lanMu";

        System.Data.SqlClient.SqlDataReader sdr = sqlhelper.ExcuteSqlDataReader(sql, null);

        while (sdr.Read())

        {

            result += "<li><a href='showlist.aspx?id=" + sdr["lanMuId"] + "'>";

            result += sdr["lanMuName"].ToString() + "</a>" + "</li>";

        }

        sdr.Close();

        return result;

    }

    public static bool addLanMu(Lanmu l)

    {

        string sqlString = "insert into t_lanMu (lanMuName) values('" + l.lanMuName + "')";

        return sqlhelper.excuteBool(sqlString);

    }

    public static bool delLanMu(string id)

    {

        string sqlString = "delete from t_lanMu where lanMuId=" + id;

        return sqlhelper.excuteBool(sqlString);

    }

    public static bool editLanMu(Lanmu l)

    {

        string sqlString = "update t_lanMu set lanMuName='" + l.lanMuName + "'  where lanMuId=" + l.lanMuId;

        return sqlhelper.excuteBool(sqlString);

    }

}

5.2.2栏目部分

增加栏目(addLanMu.aspx.cs):

public partial class yf_addNews : System.Web.UI.Page

{

    Users u;

    protected void Page_Load(object sender, EventArgs e)

    {

        if (Session["user"] == null)

        {

            Response.Redirect("index.aspx");

        }

        else

        {

            u=(Users)Session["user"];

        }

        if (!IsPostBack)//防止没有取到下拉菜单值

        {

            ddlLanMu.DataSource = Lanmu.getLanMuList();

            ddlLanMu.DataTextField = "lanMuName";

            ddlLanMu.DataValueField = "lanMuId";

            ddlLanMu.DataBind();

            if (Request.QueryString["id"] != null)

            {

                string id = Request.QueryString["id"].ToString();

                News n = News.getNewsById(id);

                txtTitle.Text = n.title;

                content1.Value = n.contents;

                foreach (ListItem x in ddlLanMu.Items)

                {

                    if (x.Value == n.lanMuId.ToString())

                    {

                        x.Selected = true;

                    }

                }

            }

        }

    }

    protected void btnSubmit_Click(object sender, EventArgs e)

    {

        News n = new News();

        n.title = txtTitle.Text;

        n.contents = content1.Value;

        n.addTime = DateTime.Now;

        n.hitCount = 0;

        n.lanMuId =Convert.ToInt32(ddlLanMu.SelectedValue);

        n.uid = u.uid;

        n.img = txtImgUrl.Text;

        if (News.addNews(n)== true )

            Response.Write("<script>alert('发布成功!')</script>");

        else

            Response.Write("<script>alert('发布失败!')</script>");

    }

    protected void btnBack_Click(object sender, EventArgs e)

    {

        Response.Redirect("manage.aspx");

    }

}

编辑栏目(editLanMu.aspx.cs):

public partial class yf_editLanMu : System.Web.UI.Page

{

    protected void Page_Load(object sender, EventArgs e)

    {

    }

    protected void submitEditLanMu_Click(object sender, EventArgs e)

    {

        Lanmu l = new Lanmu();

        l.lanMuName = editLanMu.Text;

        l.lanMuId = Convert.ToInt32(Request.QueryString["id"].ToString());

        if (Lanmu.editLanMu(l) == true)

            Response.Write("<script>alert('修改成功!')</script>");

        else

            Response.Write("<script>alert('修改失败!')</script>");

    }

    protected void back_Click(object sender, EventArgs e)

    {

        Response.Redirect("lanmuManage.aspx");

    }

}

栏目管理(lanmuManage.aspx.cs):

public partial class yf_LanMumanage : System.Web.UI.Page

{

    protected void Page_Load(object sender, EventArgs e)

    {

        if (Session["user"] == null)

        {

            Response.Write("<script>alert('您尚未登录!')</script>");

            Response.Redirect("index.aspx");

        }

        else

        {

            Users u = (Users)Session["user"];

            bigUser.Text = "欢迎" + u.userName;

        }

        showLanMuList();

    }

 

    public void showLanMuList()

    {

        gvLanMu.DataSource = Lanmu.getLanMuList();

        gvLanMu.DataBind();

    }

    protected void delLanMu_Click(object sender, EventArgs e)

    {

        LinkButton btn = (LinkButton)sender;

        GridViewRow gvr = (GridViewRow)btn.NamingContainer;

        string id = gvr.Cells[0].Text;

        if (Lanmu.delLanMu(id) == true && (Convert.ToInt32(id) != 1))

        {

            Response.Write("<script>alert('删除成功!')</script>");

            showLanMuList();

        }

        else

            Response.Write("<script>alert('删除失败!')</script>");

    }

    protected void editLanMu_Click(object sender, EventArgs e)

    {

        LinkButton btn = (LinkButton)sender;

        GridViewRow gvr = (GridViewRow)btn.NamingContainer;

        string id = gvr.Cells[0].Text;

        Response.Redirect("editLanMu.aspx?id=" + id);

    }

    protected void addLanMu_Click(object sender, EventArgs e)

    {

        Response.Redirect("addLanMu.aspx");

    }

    protected void backtomanage_Click(object sender, EventArgs e)

    {

        Response.Redirect("manage.aspx");

    }

    protected void setManage_Click(object sender, EventArgs e)

    {

        LinkButton btn = (LinkButton)sender;

        GridViewRow gvr = (GridViewRow)btn.NamingContainer;

        string id = gvr.Cells[0].Text;

        Response.Redirect("setManage.aspx?id=" + id);

    }

}

5.2.3用户部分

添加用户(addUsers.aspx.cs):

public partial class yf_addUser : System.Web.UI.Page

{

    protected void Page_Load(object sender, EventArgs e)

    {

    }

    protected void submitUser_Click(object sender, EventArgs e)

    {

        if (addUserName.Text.Trim() == "" || addUserPwd.Text.Trim() == "")

        {

            Response.Write("<script>alert('用户名和密码不能为空。');</script>");

        }

        else

        {

            Users n = new Users();

            n.userName = addUserName.Text;

            n.passWord = addUserPwd.Text;

            if (Users.addUser(n) == true)

                Response.Write("<script>alert('添加成功')</script>");

            else

                Response.Write("<script>alert('添加失败')</script>");

        }

    }

    protected void back_Click(object sender, EventArgs e)

    {

        Response.Redirect("userManage.aspx");

    }

}

编辑用户(editUsers.aspx.cs):

public partial class yf_editUser : System.Web.UI.Page

{

    Users u;

    protected void Page_Load(object sender, EventArgs e)

    {

        if (Session["user"] == null)

            Response.Redirect("index.aspx");

        else

            u = (Users)Session["user"];

        if (!IsPostBack)

        {

            if (Request.QueryString["id"] != null)

            {

                string id = Request.QueryString["id"].ToString();

                Users n = Users.getUserById(id);

                editUserName.Text = n.userName;

                editUserPwd.Text = n.passWord;

            }

        }

    }

    protected void submitEditUser_Click(object sender, EventArgs e)

    {

        Users n = new Users();

        n.userName = editUserName.Text;

        n.passWord = editUserPwd.Text;

        n.uid = Convert.ToInt32(Request.QueryString["id"].ToString());

        if (Users.editUser(n) == true)

            Response.Write("<script>alert('修改成功')</script>");

        else

            Response.Write("<script>alert('修改失败')</script>");

    }

    protected void back_Click(object sender, EventArgs e)

    {

        Response.Redirect("manage.aspx");

    }

}

管理用户(userManage.aspx.cs):

public partial class yf_userManage : System.Web.UI.Page

{

    protected void Page_Load(object sender, EventArgs e)

    {

        if (Session["user"] == null)

        {

            Response.Write("<script>alert('您尚未登录')</script>");

            Response.Redirect("index.aspx");

        }

        else

        {

            Users u = (Users)Session["user"];

             bigUser.Text = "欢迎" + u.userName;

        }

        showUserList();

    }

    public void showUserList()

    {

        gvUser.DataSource = Users.getUserList();

        gvUser.DataBind();

    }

    protected void editUser_Click(object sender, EventArgs e)

    {

        LinkButton btn = (LinkButton)sender;

        GridViewRow gvr = (GridViewRow)btn.NamingContainer;

        string id = gvr.Cells[0].Text;

        Response.Redirect("editUser.aspx?id=" + id);

    }

    protected void deleteUser_Click(object sender, EventArgs e)

    {

        LinkButton btn = (LinkButton)sender;

        GridViewRow gvr = (GridViewRow)btn.NamingContainer;

        string id = gvr.Cells[0].Text;

        if (Users.delUser(id) == true&&(Convert.ToInt32(id)!=1))

        {

            Response.Write("<script>alert('删除成功')</script>");

            showUserList();

        }

        else

        {

            Response.Write("<script>alert('删除失败')</script>");

        }

    }

    protected void Button1_Click(object sender, EventArgs e)

    {

        Response.Redirect("addUser.aspx");

    }

    protected void back_Click(object sender, EventArgs e)

    {

        Response.Redirect("manage.aspx");

    }

}

5.2.4新闻部分

添加新闻(addNews.aspx.cs):

public partial class yf_addNews : System.Web.UI.Page

{

    Users u;

    protected void Page_Load(object sender, EventArgs e)

    {

        if (Session["user"] == null)

        {

            Response.Redirect("index.aspx");

        }

        else

        {

            u=(Users)Session["user"];

        }

        if (!IsPostBack)

        {

            ddlLanMu.DataSource = Lanmu.getLanMuList();

            ddlLanMu.DataTextField = "lanMuName";

            ddlLanMu.DataValueField = "lanMuId";

            ddlLanMu.DataBind();

            if (Request.QueryString["id"] != null)

            {

                string id = Request.QueryString["id"].ToString();

                News n = News.getNewsById(id);

                txtTitle.Text = n.title;

                content1.Value = n.contents;

                foreach (ListItem x in ddlLanMu.Items)

                {

                    if (x.Value == n.lanMuId.ToString())

                    {

                        x.Selected = true;

                    }

                }

            }

        }

    }

    protected void btnSubmit_Click(object sender, EventArgs e)

    {

        News n = new News();

        n.title = txtTitle.Text;

        n.contents = content1.Value;

        n.addTime = DateTime.Now;

        n.hitCount = 0;

        n.lanMuId =Convert.ToInt32(ddlLanMu.SelectedValue);

        n.uid = u.uid;

        n.img = txtImgUrl.Text;

        if (News.addNews(n)== true )

            Response.Write("<script>alert('发布成功')</script>");

        else

            Response.Write("<script>alert('发布失败')</script>");

    }

    protected void btnBack_Click(object sender, EventArgs e)

    {

        Response.Redirect("manage.aspx");

    }

}

编辑新闻(editNews.aspx.cs):

public partial class yf_editeNews : System.Web.UI.Page

{

    Users u;

    protected void Page_Load(object sender, EventArgs e)

    {

        if (Session["user"] == null)

            Response.Redirect("index.aspx");

        else

            u = (Users)Session["user"];

        if (!IsPostBack)

        {

            ddlLanMu.DataSource = Lanmu.getLanMuList();

            ddlLanMu.DataTextField = "lanMuName";

            ddlLanMu.DataValueField = "lanMuId";

            ddlLanMu.DataBind();

            if (Request.QueryString["id"] != null)

            {

                string id = Request.QueryString["id"].ToString();

                News n = News.getNewsById(id);

                txtTitle.Text = n.title;

                content1.Value = n.contents;

                foreach (ListItem x in ddlLanMu.Items)

                {

                    if (x.Value == n.lanMuId.ToString())

                    {

                        x.Selected = true;

                    }

                }

            }

        }

    }

    protected void btnEdit_Click(object sender, EventArgs e)

    {

        News n = new News();

        n.title = txtTitle.Text;

        n.contents = content1.Value;

        n.uid = u.uid;

        n.lanMuId =Convert.ToInt32(ddlLanMu.SelectedValue);

        n.newid = Convert.ToInt32(Request.QueryString["id"].ToString());

        n.img = txtImgUrl.Text;

        if (News.editNews(n)== true)

            Response.Write("<script>alert('修改成功')</script>");

        else

            Response.Write("<script>alert('修改失败')</script>");

    }

    protected void btnCancel_Click(object sender, EventArgs e)

    {

        Response.Redirect("manage.aspx");

    }

}

给新闻设置管理员:(setManage.aspx.cs

public partial class yf_setManage : System.Web.UI.Page

{

    Users u;

    protected void Page_Load(object sender, EventArgs e)

    {

        if (Session["user"] == null)

        {

            Response.Redirect("index.aspx");

        }

        else

        {

            u = (Users)Session["user"];

        }

        if (!IsPostBack)//防止没有正确取到下拉菜单里的值

        {

            userList.DataSource = Users.getUserList();

            userList.DataTextField = "userName";

            userList.DataValueField = "uid";

            userList.DataBind();

            if (Request.QueryString["id"] != null)

            {

                string id = Request.QueryString["id"].ToString();

                Users n = Users.getUserById(id);       

                foreach (ListItem x in userList.Items)

                {

                    if (x.Value == n.manageLanmuid.ToString())

                    {

                        x.Selected = true;

                    }

                }

            }

        }

    }

    protected void setManage_Click(object sender, EventArgs e)

    {

        Users n = new Users();

        n.manageLanmuid = Convert.ToInt32(Request.QueryString["id"].ToString());

        int id = Convert.ToInt32(userList.SelectedValue);

        Users p = Users.getUserById(id.ToString());//根据栏目id找user

 

        n.uid = p.uid;

        n.userName = p.userName;

        n.passWord = p.passWord;

        if (Users.giveUseraddlanmu(n) == true)

            Response.Write("<script>alert('设置成功')</script>");

        else

            Response.Write("<script>alert('设置失败')</script>");

    }

    protected void back_Click(object sender, EventArgs e)

    {

        Response.Redirect("lanmuManage.aspx");

    }

}

新闻搜索(Search.aspx.cs):

public partial class Search : System.Web.UI.Page

{

    protected void Page_Load(object sender, EventArgs e)

    {

        if (Request.QueryString["text"] != null)

        {

            string search = Request.QueryString["text"];

            SearchHotNews.DataSource = sqlhelper.excuteDataSet("select * from t_news where title like  '%" + search + "%' or contents like '%" + search + "%' order by hitCount DESC");

            SearchHotNews.DataBind();

            SearchNews.DataSource = sqlhelper.excuteDataSet("select * from t_news where title like  '%" + search + "%' or contents like '%" + search + "%' order by addTime DESC");

            SearchNews.DataBind();

        }

        else

        {

        }

    }

}

菜单栏目新闻(showlist.aspx.cs):

public partial class showlist : System.Web.UI.Page

{

    protected void Page_Load(object sender, EventArgs e)

    {

        if (Request.QueryString["id"] != null)

        {

            //将栏目id作为参数,根据传递的栏目id值显示

            string id = Request.QueryString["id"].ToString();

            SqlConnection con = sqlhelper.createCon();

            con.Open();

            string sql = "select * from t_news where lanMuId=@lanMuId order by hitCount DESC";

            SqlCommand cmd = con.CreateCommand();

            cmd.CommandText = sql;

            cmd.Parameters.Add(new SqlParameter("@lanMuId", id));

            SqlDataAdapter sda = new SqlDataAdapter(cmd);

            DataSet ds = new DataSet();

            sda.Fill(ds);

            con.Close();

            gvHotNews.DataSource = ds;

            gvHotNews.DataBind();

            gvNews.DataSource = sqlhelper.excuteDataSet("select * from t_news order by addTime DESC");

            gvNews.DataBind();

        }

    }

}

单篇新闻(shownews.aspx.cs:

public partial class shownews : System.Web.UI.Page

{

    protected void Page_Load(object sender, EventArgs e)

    {

        if(Request.QueryString["id"]!=null)

        {

            string id=Request.QueryString["id"].ToString();

            News.addHitCount(id);

            News n = News.getNewsById(id);

            lblTitle.Text = n.title;

            lblContent.Text = n.contents;

            lblAddTime.Text = "发布时间"+n.addTime.ToString();

            lblAuthor.Text ="发布者"+ n.uid.ToString();

            lblHitCount.Text ="点击次数"+ n.hitCount;

        }

    }

    protected void shownewssure_Click(object sender, EventArgs e)

    {

        if (shownewssure.Text.Trim() == "")

        {

            Response.Write("<script>alert('输入为空')</script>");

        }

        else

        {

            Response.Redirect("Search.aspx?text=" + shownewsSearch.Text);

        }

    }

}

转载于:https://www.cnblogs.com/mookking/p/9655240.html

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/396840.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

洛谷-求同构数的个数-NOIP2013提高组复赛

题目描述 Description 所谓同构数是指这样的数&#xff0c;即它出现在它的平方数的右端。例如&#xff0c;5的平方是25 &#xff08;即5525&#xff09;&#xff0c;5是25右端的数&#xff0c;那么5就是同构数。又如&#xff0c;25的平方是625&#xff08;即2525625&#xff09…

plex linux 数据目录,shareplex日常维护文档

2017/07/25##SharePlex日常维护源(SRC)&#xff1a;192.168.1.101 db01目标(TGT):192.168.1.102 db02SRC:su - oraclesp_ctrlshowqstatusshow capture detailshow read detailshow log reverseshow config --查看当前使用参数文件list config --罗列出所有的参数文件(使用和未使…

ifconfig命令找不到_02. Linux命令之查看网络连接

1. 查看网络连接数和端口使用 netstat 命令查看网络连接情况netstat -anp参数&#xff1a;-a 显示所有选项-t (tcp)仅显示tcp相关选项-u (udp)仅显示udp相关选项-n 拒绝显示别名&#xff0c;能显示数字的全部转化成数字。-p 显示建立相关链接的程序名关键列解释:Proto 表示协议…

grep与egrep的区别

grep与egrep的区别&#xff1b; 在linux系统环境下&#xff0c;我们通常使用grep命令来过滤出需要的行而egrep确很少使用&#xff0c;他们的区别其实很简单&#xff0c;grep默认不支持正则表达式&#xff0c;egrep默认支持正则表达式&#xff0c;egrep 等于 grep -E 命令。转载…

python学习之模块(pip),列表生成式,模块操作mysql,excel

python基础 生成式 列表生成式  格式 [表达式 for 表达式 in 迭代对象 (可加判断)] 原&#xff1a; 1 res1 [] 2 for i in range(1,5): 3   res1.append(i) 4 print(res1) 改&#xff1a; 1 res2 [i for i in range(1,5)] 2 print(res2) 字典生成式  格式 {key:value f…

linux驱动read函数 copytouser,Linux驱动编程 step-by-step (五)主要的文件操作方法实现...

主要的文件操作方法实现文件操作函数有很多的操作接口&#xff0c;驱动编程需要实现这些接口&#xff0c;在用户编程时候系统调用时候会调用到这些操作structfile_operations {...loff_t (*llseek) (structfile *, loff_t,int);ssize_t (*read) (structfile *,char__user *,siz…

web开发中的 emmet 效率提升工具

web开发中的 emmet 效率提升工具 可以用来快速生成html 代码。 并且给各种IDE、编辑器提供了插件支持&#xff0c;sublime &#xff0c;webstorm等。 如在webstorm中安装好emmet之后&#xff0c;输入以下文本&#xff0c; #page>div.content[ng-model"user"]ul>…

python二维数组操作_Python二维数组应用与操作

课课家将会在这里为大家详细的介绍一下Python二维数组的相关应用方法以及定义方式&#xff0c;相信朋友们可以从中学习到更多的知识。 Python数组的应用中在实际编程中是一个非常重要的应用技术&#xff0c;作为Python编程人员来说&#xff0c;必须要熟练的掌握这方面的所有应用…

基于光线追踪的渲染中景深(Depth of field)效果的实现

图形学离线渲染中常用的透视摄像机模型时根据小孔成像的原理建立的&#xff0c;其实现通常是从向成像平面上发射ray&#xff0c;并把trace这条ray的结果作为成像平面上对应交点的采样结果。即&#xff1a; 图片来自《Fundamentals of Computer Graphics》 现实中的镜头拍摄的图…

ubuntu 安装 pycharm

添加源&#xff1a;$ sudo add-apt-repository ppa:mystic-mirage/pycharm安装收费的专业版&#xff1a;$ sudo apt update$ sudo apt install pycharm安装免费的社区版&#xff1a;$ sudo apt update$ sudo apt install pycharm-community卸载&#xff1a;$ sudo apt remove p…

带你制作百词斩单词表读写插件

上篇博文简单的介绍了一下Chrome插件&#xff0c;今天就与大家分享一下我做的这款有实际意义的插件吧。 做这款插件主要是用百词斩站点进行单词学习时&#xff0c;遇到的一点点闹心事儿。在单词表中不能听发音。也不能练习拼写。所以才忍无可忍的做了这么一款插件。自我感觉还是…

Linux7改运行级别,Centos7.0修改系统运行级别

首先翻译下ininttab里面的内容&#xff1a;#inittab不再使用时利用系统。#添加配置这会对你的系统没有影响。#Ctrl-Alt-Delete由/usr/lib系统/系统/ctrl-alt-del.target处理#系统使用的目标而不是运行级别。默认情况下&#xff0c;有两个主要目标&#xff1a;#multi-user.targe…

python测试字符串类型的函数_python-02 数据类型 字符串str

字符串str 一、字符串定义 概念&#xff1a;字符串是有序的 不可修改的&#xff0c;元素以引号包围的序列 引号类型&#xff1a;单引号 “”双引号 “ ””三引号 三单引号 print(python) print("python") print(python) print("""python""…

POJ2115 C Looooops(线性同余方程)

无符号k位数溢出就相当于mod 2k&#xff0c;然后设循环x次A等于B&#xff0c;就可以列出方程&#xff1a; $$ CxA \equiv B \pmod {2^k} $$ $$ Cx \equiv B-A \pmod {2^k} $$ 最后就用扩展欧几里得算法求出这个线性同余方程的最小非负整数解。 1 #include<cstdio>2 #incl…

工作测试博客

工作测试博客转载于:https://blog.51cto.com/12559670/1895000

iphone各机型参数对比_带你了解新款iPhone 12系列四款机型

2020年10月14日凌晨1&#xff1a;00&#xff0c;苹果召开新品发布会&#xff0c;发布了新款iPhone 12系列手机&#xff0c;“果粉”们期待已久的iPhone 12终于来了。iPhone 12系列手机共有四款机型&#xff0c;分别是iPhone 12 mini、iPhone 12、iPhone 12 Pro、iPhone 12 Pro …

设置开机自启动服务

一、软链接方法 利用ln -s 命令将/etc/rc.d/init.d/目录下脚本&#xff08;注意执行权限&#xff09;软连接到 rc3目录下&#xff0c;/etc/rc.d/rc3.d 目录也就是我们一般的系统运行级别。ln -s /etc/rc.d/init.d/** /etc/rc.d/rc3.d/S**这里的S代表的是开机自启动服务&#x…

mysql benchmark基准测试

git项目地址&#xff1a; https://github.com/akopytov/sysbench 利用sysbench很容易对mysql做性能基准测试&#xff08;当然这个工具很强大&#xff0c;除了测试主流数据库性能&#xff0c;还能测试其它方面&#xff0c;详情自己看官网项目文档&#xff09; mac上的用法&#…

高并发第一弹:准备阶段 了解高并发

高并发第一弹:准备阶段 了解高并发 首先需要知道什么并发, 什么是高并发. 并发: 关于并发的学习&#xff0c;可以从JDK提供的并发包为核心开始&#xff0c;许多其他的类和封装都是对其进行扩展或者补充&#xff0c;我们来看一下Java并发包(java.util.concurrent包&#xff0c;简…

matlab立体坐标定位_【半导光电】基于光电探测器的激光章动定位算法(二)

今日光电有人说&#xff0c;20世纪是电的世纪&#xff0c;21世纪是光的世纪&#xff1b;知光解电&#xff0c;再小的个体都可以被赋能。欢迎来到今日光电&#xff01;----与智者为伍 为创新赋能----1. 章动定位算法实验前&#xff0c;首先需要对光路进行调节&#xff0c;保证经…