JSP第十次作业
1.实现 删除 回复邮件
2.实现阅读邮件功能:在main.jsp中点击任意邮件的标题,进入到detail.jsp显示邮件详情,包括发件人,主题,内容,时间。同时需要把邮件状态修改为已读。
com.gd.dao
1 package com.gd.dao;
2
3 import java.sql.Connection;
4 import java.sql.DriverManager;
5 import java.sql.PreparedStatement;
6 import java.sql.ResultSet;
7 import java.sql.SQLException;
8
9 public class BaseDao {
10 //获取连接
11 protected Connection getConnection(){
12 Connection conn=null;
13 try {
14 Class.forName("com.mysql.jdbc.Driver");
15 // 2.建立连接
16 conn = DriverManager.getConnection(
17 "jdbc:mysql://localhost:3306/test", "root", "123456");
18 } catch (Exception e) {
19 e.printStackTrace();
20 }
21 return conn;
22 }
23 //关闭连接
24 protected void closeAll(Connection con,PreparedStatement ps,ResultSet rs){
25 try {
26 if(rs != null)
27 rs.close();
28 if(ps != null)
29 ps.close();
30 if(con != null)
31 con.close();
32
33 } catch (SQLException e) {
34 e.printStackTrace();
35 }
36 }
37
38 }
1 package com.gd.dao;
2
3 import java.sql.Connection;
4 import java.sql.PreparedStatement;
5 import java.sql.ResultSet;
6 import java.sql.SQLException;
7 import java.util.ArrayList;
8 import java.util.Date;
9 import java.util.List;
10
11 import com.gd.entity.Msg;
12
13 public class MsgDao extends BaseDao {
14 //根据收件人查看全部邮件
15 public List<Msg> getMailByReceiver(String name){
16 List<Msg> list=new ArrayList<Msg>();
17 Connection con=getConnection();
18 String sql="select * from msg where sendto=?";
19 PreparedStatement ps=null;
20 ResultSet rs=null;
21 try {
22 ps = con.prepareStatement(sql);
23 ps.setString(1, name);
24 rs=ps.executeQuery();
25 while(rs.next()){
26 //每读取一行,创建一个msg对象,对象放到集合中
27 Msg m=new Msg();
28 m.setMsgid(rs.getInt(1));
29 m.setUsername(rs.getString(2));
30 m.setTitle(rs.getString(3));
31 m.setMsgcontent(rs.getString(4));
32 m.setState(rs.getInt(5));
33 m.setSendto(rs.getString(6));
34 m.setMsg_create_date(rs.getDate(7));
35 list.add(m);
36 }
37
38 } catch (SQLException e) {
39 // TODO Auto-generated catch block
40 e.printStackTrace();
41 }finally{
42 closeAll(con, ps, rs);
43 }
44 return list;
45 }
46 //关于邮件的增删改查
47 //添加邮件(写邮件,回复邮件都调用,邮件状态为1(未读),时间为系统当前时间)
48 public void addMsg(Msg m){
49 Connection conn=getConnection();
50 String sql="insert into msg(username,title,msgcontent,state,sendto,msg_create_date) values(?,?,?,1,?,?)";
51 PreparedStatement ps=null;
52 try {
53 ps=conn.prepareStatement(sql);
54 ps.setString(1, m.getUsername());
55 ps.setString(2, m.getTitle());
56 ps.setString(3, m.getMsgcontent());
57 ps.setString(4, m.getSendto());
58 ps.setDate(5, new java.sql.Date(new Date().getTime()));
59 ps.executeUpdate();
60 } catch (SQLException e) {
61 // TODO Auto-generated catch block
62 e.printStackTrace();
63 }finally{
64 closeAll(conn, ps, null);
65 }
66 }
67
68 //根据id删除邮件
69 public void delMsg(int id){
70 Connection con=getConnection();
71 String sql="delete from msg where msgid="+id;
72 PreparedStatement ps=null;
73 try {
74 ps=con.prepareStatement(sql);
75 ps.executeUpdate();
76 } catch (SQLException e) {
77 // TODO Auto-generated catch block
78 e.printStackTrace();
79 }finally{
80 closeAll(con, ps, null);
81 }
82 }
83 public void updateMsg(int id) {
84 Connection con = getConnection();
85 String sql = "update msg set state='1' where msgid=?";
86 PreparedStatement pred = null;
87 try {
88 pred = con.prepareStatement(sql);
89 pred.setInt(1, id);
90 pred.executeUpdate();
91 } catch (SQLException e1) {
92 e1.printStackTrace();
93 } finally {
94 closeAll(con, pred, null);
95 }
96 }
97
98 public Msg read(int id) {
99 Connection con = getConnection();
100 String sql = "select msgid,username,sendto,title,msgcontent,msg_create_date from msg where msgid=?";
101 PreparedStatement ps = null;
102 ResultSet rs = null;
103 try {
104 ps = con.prepareStatement(sql);
105 ps.setInt(1, id);
106 rs = ps.executeQuery();
107 while (rs.next()) {
108 Msg m = new Msg();
109 m.setMsgid(rs.getInt("msgid"));
110 m.setUsername(rs.getString("username"));
111 m.setTitle(rs.getString("title"));
112 m.setMsgcontent(rs.getString("msgcontent"));
113 m.setSendto(rs.getString("sendto"));
114 m.setMsg_create_date(rs.getDate("msg_create_date"));
115 return m;
116 }
117
118 } catch (SQLException e) {
119 e.printStackTrace();
120 } finally {
121 closeAll(con, ps, rs);
122 }
123 return null;
124 }
125 }
1 package com.gd.dao;
2
3 import java.sql.Connection;
4 import java.sql.PreparedStatement;
5 import java.sql.ResultSet;
6 import java.sql.SQLException;
7
8 public class UsersDao extends BaseDao {
9 // 登陆
10 public boolean login(String uname, String upwd) {
11 boolean f = false;
12 Connection conn = getConnection();
13 String sql = "select * from users where uname=? and upwd=?";
14 PreparedStatement ps = null;
15 ResultSet rs = null;
16 try {
17 ps = conn.prepareStatement(sql);
18 ps.setString(1, uname);// 第一个?赋值为name
19 ps.setString(2, upwd);
20 rs = ps.executeQuery();
21 if (rs.next())// 查到结果了
22 f = true;
23 } catch (SQLException e) {
24 // TODO Auto-generated catch block
25 e.printStackTrace();
26 } finally {
27 closeAll(conn, ps, rs);
28 }
29 return f;
30 }
31 // 注册
32 public int reg(String uname,String upwd){
33 int i=-1;
34 PreparedStatement pred=null;
35 Connection con=getConnection();
36 String sql="insert into users(uname,upwd)values(?,?)";
37 try {
38 pred= con.prepareStatement(sql);
39 pred.setString(1, uname);
40 pred.setString(2, upwd);
41 i=pred.executeUpdate();
42 } catch (SQLException e) {
43 e.printStackTrace();
44 }finally{
45 closeAll(con, pred, null);
46 }
47 return i;
48 }
49 }
com.gd.entity
1 package com.gd.entity;
2
3 import java.util.Date;
4
5 public class Msg {
6 private Integer msgid;
7 private String username;
8 private String title;
9 private String msgcontent;
10 private int state;
11 private String sendto;
12 private Date msg_create_date;
13
14 public Msg() {
15 super();
16 // TODO Auto-generated constructor stub
17 }
18
19 public Msg(Integer msgid, String username, String title, String msgcontent,
20 int state, String sendto, Date msg_create_date) {
21 super();
22 this.msgid = msgid;
23 this.username = username;
24 this.title = title;
25 this.msgcontent = msgcontent;
26 this.state = state;
27 this.sendto = sendto;
28 this.msg_create_date = msg_create_date;
29 }
30
31 public Integer getMsgid() {
32 return msgid;
33 }
34
35 public void setMsgid(Integer msgid) {
36 this.msgid = msgid;
37 }
38
39 public String getUsername() {
40 return username;
41 }
42
43 public void setUsername(String username) {
44 this.username = username;
45 }
46
47 public String getTitle() {
48 return title;
49 }
50
51 public void setTitle(String title) {
52 this.title = title;
53 }
54
55 public String getMsgcontent() {
56 return msgcontent;
57 }
58
59 public void setMsgcontent(String msgcontent) {
60 this.msgcontent = msgcontent;
61 }
62
63 public int getState() {
64 return state;
65 }
66
67 public void setState(int state) {
68 this.state = state;
69 }
70
71 public String getSendto() {
72 return sendto;
73 }
74
75 public void setSendto(String sendto) {
76 this.sendto = sendto;
77 }
78
79 public Date getMsg_create_date() {
80 return msg_create_date;
81 }
82
83 public void setMsg_create_date(Date msg_create_date) {
84 this.msg_create_date = msg_create_date;
85 }
86
87
88 }
1 package com.gd.entity;
2
3 public class Users {
4 private Integer id;
5 private String uname;
6 private String upwd;
7
8 public Users() {
9 super();
10 // TODO Auto-generated constructor stub
11 }
12
13 public Users(Integer id, String uname, String upwd) {
14 super();
15 this.id = id;
16 this.uname = uname;
17 this.upwd = upwd;
18 }
19
20 public Integer getId() {
21 return id;
22 }
23
24 public void setId(Integer id) {
25 this.id = id;
26 }
27
28 public String getUname() {
29 return uname;
30 }
31
32 public void setUname(String uname) {
33 this.uname = uname;
34 }
35
36 public String getUpwd() {
37 return upwd;
38 }
39
40 public void setUpwd(String upwd) {
41 this.upwd = upwd;
42 }
43
44 }
jsp
reg.jsp
1 <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
2 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
3 <html>
4 <head>
5 <title>My JSP 'reg.jsp' starting page</title>
6 </head>
7
8 <body>
9 <h1>注册</h1>
10 <script>
11 function yz() {
12 if (form.uname.value == "") {
13 alert('用户名不能为空');
14 return;
15 }
16 if (form.upwd.value == "") {
17 alert('密码不能为空');
18 return;
19 }
20 form.submit();
21 }
22 </script>
23 <form action="doreg.jsp" method="post" name="form">
24 <table>
25 <tr>
26 <td>用户名</td>
27 <td><input type="text" name="uname"></td>
28 </tr>
29 <tr>
30 <td>密码</td>
31 <td><input type="password" name="upwd" value="123456"></td>
32 </tr>
33 <tr>
34 <td><input type="button" value="注册" onclick="yz()"></td>
35 <td><a href="denglu.jsp">登录</a></td>
36 </tr>
37 </table>
38 </form>
39 </body>
40 </html>
doreg.jsp
1 <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
2 <%@page import="com.gd.dao.UsersDao"%>
3 <%
4 request.setCharacterEncoding("utf-8");
5 response.setCharacterEncoding("utf-8");
6 %>
7 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
8 <html>
9 <head>
10 <title>My JSP 'doreg.jsp' starting page</title>
11 </head>
12 <body>
13 <%
14 String uname = request.getParameter("uname");
15 String upwd = request.getParameter("upwd");
16 UsersDao ud = new UsersDao();
17 int i = ud.reg(uname, upwd);
18 if (i > 0) {
19 out.print("注册成功,即将跳到登录页.....");
20 response.setHeader("refresh", "2;url=denglu.jsp");
21 } else {
22 out.print("注册失败,即将跳回注册页.....");
23 response.setHeader("refresh", "2;url=reg.jsp");
24 }
25 %>
26 </body>
27 </html>
denglu.jsp
1 <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
2 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
3 <html>
4 <head>
5 <title>My JSP 'denglu.jsp' starting page</title>
6 </head>
7
8 <body>
9 <h1>登录</h1>
10 <script type="text/javascript">
11 function validate() {
12 if (loginForm.uname.value == "") {
13 alert("账号不能为空!");
14 return;
15 }
16 if (loginForm.upwd.value == "") {
17 alert("密码不能为空!");
18 return;
19 }
20 loginForm.submit();
21 }
22 </script>
23 <form name="loginForm" action="dologin.jsp" method="post">
24 用户名:<input type="text" name="uname"><br> 密码: <input
25 type="password" name="upwd" value="123456"><br> <input
26 type="button" value="登录" onClick="validate()"> <a
27 href="reg.jsp">立即注册</a>
28 </form>
29 </body>
30 </html>
dologin.jsp
1 <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
2 <%@page import="com.gd.dao.UsersDao"%>
3 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
4 <html>
5 <head>
6 <title>My JSP 'dologin.jsp' starting page</title>
7 </head>
8 <body>
9 <%
10 request.setCharacterEncoding("utf-8");
11 String uname = request.getParameter("uname");
12 String upwd = request.getParameter("upwd");
13 UsersDao ud = new UsersDao();
14 if (ud.login(uname, upwd)) {
15 session.setAttribute("uname", uname);
16 request.getRequestDispatcher("main.jsp").forward(request,
17 response);
18 } else {
19 out.print("登陆失败,即将跳回登陆页.....");
20 response.setHeader("refresh", "5;url=denglu.jsp");
21 }
22 %>
23 </body>
24 </html>
main.jsp
1 <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
2 <%@page import="com.gd.entity.Msg"%>
3 <%@page import="com.gd.dao.MsgDao"%>
4 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
5 <html>
6 <head>
7 <title>My JSP 'main.jsp' starting page</title>
8 </head>
9 <body>
10 <%
11 MsgDao md = new MsgDao();
12 String uname = (String) session.getAttribute("uname");
13 List<Msg> list = md.getMailByReceiver(uname);
14 %>
15 欢迎你<%=uname%>
16 <a href="write.jsp">写邮件</a>
17 <a href="exit.jsp">退出登录</a>
18 <table border="1">
19 <tr>
20 <td>发件人</td>
21 <td>主题</td>
22 <td>状态</td>
23 <td>时间</td>
24 <td>操作</td>
25 <td>操作</td>
26 </tr>
27
28 <%
29 for (int i = 0; i < list.size(); i++) {
30 %>
31 <tr>
32 <td><%=list.get(i).getUsername()%></td>
33 <td><a href="detail.jsp?id=<%=list.get(i).getMsgid()%>">
34 <%out.print(list.get(i).getTitle().toString());%>
35 </a>
36 </td>
37 <td>
38 <%
39 if (list.get(i).getState() == 1) {
40 %> <img src="data:images/sms_unReaded.png" /> <%
41 } else {
42 %> <img src="data:images/sms_readed.png" /> <%
43 }
44 %>
45 </td>
46 <td><%=list.get(i).getMsg_create_date()%></td>
47 <td><a href="write.jsp?reply=<%=list.get(i).getUsername()%>">回复</a>
48 </td>
49 <td><a href="del.jsp?id=<%=list.get(i).getMsgid()%>">删除</a>
50 </td>
51 </tr>
52 <%
53 }
54 %>
55 </table>
56
57 </body>
58 </html>
write.jsp
1 <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
2 <%
3 request.setCharacterEncoding("utf-8");
4 response.setCharacterEncoding("utf-8");
5 %>
6 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
7 <html>
8 <head>
9 <title>My JSP 'write.jsp' starting page</title>
10 </head>
11 <body>
12 <form action="dowrite.jsp" method="post">
13 收件人:<input type="text" name="sendto" value="<%=request.getParameter("reply") %>"><br>
14 主题: <input type="text" name="title" ><br>
15 内容:<textarea rows="6" cols="20" name="content"></textarea>
16 <br>
17 <input type="submit" value="发送">
18 </form>
19 </body>
20 </html>
dowrite.jsp
1 <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
2 <%@page import="com.gd.entity.Msg"%>
3 <%@page import="com.gd.dao.MsgDao"%>
4 <%@page import="com.gd.dao.UsersDao"%>
5 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
6 <html>
7 <head>
8 <title>My JSP 'dowrite.jsp' starting page</title>
9 </head>
10 <body>
11 <%
12 request.setCharacterEncoding("utf-8");
13
14 String uname=(String)session.getAttribute("uname");// 发件人在session中获取
15 String sendto=request.getParameter("sendto");
16 String title=request.getParameter("title");
17 String content=request.getParameter("content");
18
19 Msg m=new Msg();
20 m.setTitle(title);
21 m.setMsgcontent(content);
22 m.setUsername(uname);
23 m.setSendto(sendto);
24
25 MsgDao md=new MsgDao();
26 md.addMsg(m);
27
28 out.print("发送成功,即将跳回首页.....");
29 response.setHeader("refresh", "3;url=main.jsp");
30 %>
31 </body>
32 </html>
detail.jsp
1 <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
2 <%@page import="com.gd.dao.MsgDao"%>
3 <%@page import="com.gd.entity.Msg"%>
4 <%
5 request.setCharacterEncoding("utf-8");
6 response.setCharacterEncoding("utf-8");
7 %>
8 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
9 <html>
10 <head>
11 <title>My JSP 'detail.jsp' starting page</title>
12 </head>
13 <body>
14 <%
15 request.setCharacterEncoding("utf-8");
16 String msgid = request.getParameter("id");
17 int idd = Integer.parseInt(msgid);
18 MsgDao md = new MsgDao();
19 md.updateMsg(idd);
20 Msg m = md.read(idd);
21 %>
22 <table>
23 <tr>
24 <td>发件人:</td>
25 <td><input type="text" name="username" style="border: none"
26 value="<%=m.getUsername()%>"></td>
27 </tr>
28 <tr>
29 <td>主题:</td>
30 <td><input type="text" name="title" style="border: none"
31 value="<%=m.getTitle()%>"></td>
32 </tr>
33 <tr>
34 <td>时间:</td>
35 <td><input type="text" name="msg_create_date"
36 style="border: none" value="<%=m.getMsg_create_date()%>"></td>
37 </tr>
38 <tr>
39 <td>收件人:</td>
40 <td><input type="text" name="sendto" style="border: none"
41 value="<%=m.getSendto()%>"></td>
42 </tr>
43 <tr>
44 <td>内容:</td>
45 <td><div style="border: none;outline: none;overflow: inherit;">
46 <%=m.getMsgcontent()%></div></td>
47 </tr>
48 </table>
49 <a href="main.jsp">返回</a>
50 </body>
51 </html>
del.jsp
1 <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
2 <%@page import="com.gd.entity.Msg"%>
3 <%@page import="com.gd.dao.MsgDao"%>
4 <%@page import="com.gd.dao.UsersDao"%>
5 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
6 <html>
7 <head>
8 <title>My JSP 'del.jsp' starting page</title>
9 </head>
10 <body>
11 <%
12 request.setCharacterEncoding("utf-8");
13 int id=Integer.parseInt(request.getParameter("id"));
14 MsgDao md=new MsgDao();
15 md.delMsg(id);
16 out.print("删除成功、、、、、、、");
17 response.sendRedirect("main.jsp");
18 %>
19 </body>
20 </html>
exit.jsp
1 <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
2
3 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
4 <html>
5 <head>
6 <title>My JSP 'exit.jsp' starting page</title>
7 </head>
8
9 <body>
10 <%
11 session.invalidate();
12 response.sendRedirect("reg.jsp");
13 %>
14 </body>
15 </html>
删除
回复:
查看内容:
搜索
复制
JSP第十次作业的更多相关文章
- JAVA第十次作业
JAVA第十次作业 (一)学习总结 1.用思维导图对java多线程的学习内容进行总结. 参考资料: XMind. 2.下面是一个单线程实现的龟兔赛跑游戏. public class TortoiseH ...
- Jsp实现在线作业提交系统
Jsp实现在线作业提交系统 作为 Computer Science 的学生,凌晨四点之前睡都应该感到羞耻. 项目托管地址:https://github.com/four-in-the-morning/ ...
- 【西北师大-2108Java】第十次作业成绩汇总
[西北师大-2108Java]第十次作业成绩汇总 作业题目 面向对象程序设计(JAVA) 第12周学习指导及要求 实验目的与要求 (1)掌握Vetor.Stack.Hashtable三个类的用途及常用 ...
- C语言程序设计第十次作业
一.实验内容 1.有5名学生,每名学生有语文.数学和外语3门课的考试成绩.编程统计各学生的总分和平均分以及所有学生各科的平均分.要求成绩在程序中初始化,结果以表格的形式输出. ...
- 史航416第十次作业&总结
作业1: 计算两数的和与差.要求自定义一个函数 #include <stdio.h> void sum_diff(float op1,float op2,float *psum , flo ...
- 集美大学网络1413第十次作业成绩(团队六) -- 展示博客(Alpha版本)
题目 团队作业6--展示博客(Alpha版本) 团队作业6成绩 团队/分值 简介& 项目地址 项目目标 (典型用户. 功能描述. 预期用户数量) 如何满足 用户需求 已完成目标 团队分工 团 ...
- C语言第十次作业
一.PTA实验作业 题目1:按等级统计学生成绩 1. 本题PTA提交列表 2.设计思路 int i,count =0 用来计未及格数 for i =0 to n if 指针p+i 指向的成绩score ...
- jsp(web作业)
一:jsp简介 SP即Java Server Pages,它和servlet技术一样,都是sun公司定义的一种用于开发动态web资源的技术.该技术的最大特点在于:写JSP就像写html,但它相比htm ...
- Java第十次作业--多线程
一.学习要点 认真看书并查阅相关资料,掌握以下内容: 理解进程和线程的区别 掌握Java多线程的两种实现方式和区别 理解线程对象的生命周期 熟悉线程控制的基本方法 掌握Java线程的同步机制 理解多线 ...
- 软工实践 - 第三十次作业 Beta答辩总结
福大软工 · 第十二次作业 - Beta答辩总结 组长本次博客作业链接 项目宣传视频链接 本组成员 1 . 队长:白晨曦 031602101 2 . 队员:蔡子阳 031602102 3 . 队员:陈 ...
随机推荐
- Jmeter之聚合报告“造假”
通过Jmeter,模拟一个"虚假"的聚合报告,可"应付"日常现场项目的性能测试验收.本文档着重介绍jmeter的固定定时器,通过设置随机的延迟时间(如想业务场景 ...
- 【深入浅出 Yarn 架构与实现】2-3 Yarn 基础库 - 服务库与事件库
一个庞大的分布式系统,各个组件间是如何协调工作的?组件是如何解耦的?线程运行如何更高效,减少阻塞带来的低效问题?本节将对 Yarn 的服务库和事件库进行介绍,看看 Yarn 是如何解决这些问题的. 一 ...
- SpringCloud——Eureka Feign Ribbon Hystrix Zuul等关键组件的学习与记录
SpringCloud--Eureka Feign Ribbon Hystrix Zuul等关键组件的学习与记录 前言:本篇是对近日学习狂神SpringCloud教程之后的感想和总结,鉴于对Sprin ...
- 【Docker】容器使用规范--安全挂载建议
容器挂载过程和安全挂载建议 绑定挂载 本文所提到的挂载主要指绑定挂载(bind mount),即通过-v /xx/xx:/xx/xx 和 --mount type=bind,xxx,xxx两种方式设置 ...
- nacos的使用
一:下载nacos 打开github搜索nacos,选择历史版本,建议下载1.4版本的,较稳定 https://github.com/alibaba/nacos 二:下载完后解压文件,两种方式打开 1 ...
- Redis 常见问题
Redis 常见问题 落叶他乡树,寒灯独夜人. 一. 什么是Redis? Redis 是一个使用 C 语言写成的,开源的高性能key-value非关系缓存数据库: Redis的数据都基于缓存的,所以很 ...
- mysql 多个结构不同表查询 返回相同字段名
( select ID,数据库原字段名1 AS 统一字段名1,数据库原字段名2 AS 统一字段名2 from 第一个表名 WHERE 1) UNION(联合表查询)( select ID,数据库原字段 ...
- 再见CMS
观察网站最下方,根据备案号搜到这是个齐博CMS,然后百度就可以搜到齐博CMS漏洞了 然后开始利用 首先尝试了在用户信息修改处进行注入,发现好像想不通了,就在博客界面进行注入 Payload: 获取版本 ...
- 【Devexpress】gridcontorl实现复制多个单元格
1.设置复制的时候不复制标题在OptionsClipboard.CopyColumnHeaders=false 2.设置选择的方式为按照单元格选择,以及可以多选 OptionsSelection.Mu ...
- C温故补缺(十四):内存管理
内存管理 stdlib库中有几个内存管理相关的函数 序号 函数和描述 1 void *calloc(int num, int size);在内存中动态地分配 num 个长度为size 个字节 的连续空 ...