11111111
1111吧
全部回复
仅看楼主
level 3
import java.io.FileOutputStream;
public class MainActivity extends AppCompatActivity {
private Button btnWriteDisk, btnReadDisk, btnWriteSD, btnReadSD, btnWriteSP, btnReadSP, btnJSON;
private TextView txtDisplay;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
btnWriteDisk = (Button) findViewById(R.id.button);
btnReadDisk = (Button) findViewById(R.id.button2);
btnWriteSD = (Button) findViewById(R.id.button3);
btnReadSD = (Button) findViewById(R.id.button4);
btnWriteSP = (Button) findViewById(R.id.button5);
btnReadSP = (Button) findViewById(R.id.button6);
btnJSON = (Button) findViewById(R.id.button7);
txtDisplay = (TextView) findViewById(R.id.textView);
// 存硬盘
btnWriteDisk.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
String str = "出塞\r\n\r\n唐·王昌龄\r\n\r\n秦时明月汉时关,\r\n\r\n万里长征人未还。\r\n\r\n但使龙城飞将在,\r\n\r\n不教胡马度阴山。";
try {
FileOutputStream fos = openFileOutput("poem1.txt", MODE_PRIVATE);
fos.write(str.getBytes());
fos.close();
Toast.makeText(MainActivity.this, "硬盘存储文件成功!", Toast.LENGTH_LONG).show();
} catch (Exception e1) {
Toast.makeText(MainActivity.this, "硬盘存储文件出现问题!", Toast.LENGTH_LONG).show();
}
}
});
}
}
2025年11月14日 03点11分 1
level 3
CREATE DATABASE book0868skx CHARACTER SET utf8 collate utf8_general_ci;
2025年12月29日 06点12分 4
level 3
2-1-1
CREATE TABLE PeopleType0868skx (
PTId TINYINT(4) PRIMARY KEY COMMENT '读者类型编号',
PType VARCHAR(24) NOT NULL COMMENT '读者类型名称',
BNum TINYINT(2) NOT NULL COMMENT '可借数量'
) COMMENT='读者类型表';
2-1-2
CREATE TABLE People0868skx (
PID INT(4) PRIMARY KEY COMMENT '读者编号',
PName VARCHAR(40) NOT NULL COMMENT '读者姓名',
PSex CHAR(2) NOT NULL DEFAULT '男性' COMMENT '读者性别',
PTypeId TINYINT(4) NOT NULL COMMENT '读者类型编号',
PAddress VARCHAR(40) DEFAULT '地址不确定' COMMENT '家庭住址',
PEmail VARCHAR(40) NOT NULL COMMENT '电子邮件' ,
FOREIGN KEY (PTypeId) REFERENCES PeopleType0868skx(PTId)
) COMMENT='读者信息表';
2-2-1
CREATE TABLE BookType0868skx(
CategoryId INT(3) PRIMARY KEY COMMENT '图书类型编号',
bName VARCHAR(14) NOT NULL COMMENT '图书类型名称'
) COMMENT = '图书类型信息表';
2-3
CREATE TABLE Publishers0868skx (
PID INT(4) PRIMARY KEY COMMENT '出版社编号',
PName VARCHAR(24) NOT NULL COMMENT '出版社名称'
) COMMENT = '出版社信息表';
2-2-2
CREATE TABLE book0868skx (
BKID INT(4) PRIMARY KEY COMMENT '图书编号',
Titles VARCHAR(40) NOT NULL COMMENT '图书名称',
writers VARCHAR(24) NOT NULL COMMENT '图书作者',
PublicId INT(4) NOT NULL COMMENT '出版社编号',
PubDate DATE NOT NULL COMMENT '出版时间',
ISBN VARCHAR(13) NOT NULL UNIQUE COMMENT 'ISBN',
Prices DECIMAL(4,2) NOT NULL COMMENT '单价',
CategoryId INT(3) NOT NULL COMMENT '图书种类编号',
FOREIGN KEY (PublicId) REFERENCES Publishers0868skx(PID),
FOREIGN KEY (CategoryId) REFERENCES bookType0868skx(CategoryId)
) COMMENT = '图书信息表';
2-4-1
CREATE TABLE Borrow0868skx(
PID INT(4) NOT NULL COMMENT '读者编号',
BKID INT(4) NOT NULL COMMENT '图书编号',
BorrowDate DATE NOT NULL COMMENT '借阅日期',
ReturnDate DATE DEFAULT NULL COMMENT '实际归还日期',
PRIMARY KEY (PID, BKID, BorrowDate),
FOREIGN KEY (PID) REFERENCES People0868skx(PID),
FOREIGN KEY (BKID) REFERENCES book0868skx(BKID)
) COMMENT = '图书借阅信息表';
2-4-2
CREATE TABLE Penalty0868skx (
PID INT(4) NOT NULL COMMENT '读者编号',
BKID INT(4) NOT NULL COMMENT '图书编号',
PDate DATE NOT NULL COMMENT '罚款日期',
PType INT NOT NULL CO
2025年12月29日 06点12分 5
level 3
2-4-2
CREATE TABLE Penalty0868skx (
PID INT(4) NOT NULL COMMENT '读者编号',
BKID INT(4) NOT NULL COMMENT '图书编号',
PDate DATE NOT NULL COMMENT '罚款日期',
PType INT NOT NULL COMMENT '罚款类型',
Amounts DECIMAL(4,2) NOT NULL COMMENT '罚款金额',
PRIMARY KEY (PID, BKID, PDate),
FOREIGN KEY (PID) REFERENCES People0868skx(PID),
FOREIGN KEY (BKID) REFERENCES book0868skx(BKID)
) COMMENT = '图书罚款信息表';
3
INSERT INTO PeopleType0868skx (PTID, PType, BNum)
VALUES
(101, '小学生', 3),
(102, '初中生', 5);
INSERT INTO People0868skx (PID, PName, PSex, PTypeId, PAddress, PEmail)
VALUES
(1001, '张飞', '男性', 102, '常州武进区', 'zhangfei@m网页链接 '),
(1002, '赵云', '女性', 101, '杭州余杭区', 'zhaoyun@网页链接 ');
INSERT INTO publishers0868skx (PID, PName)
VALUES
(12, '人民邮电出版社'),
(13, '电子工业出版社');
INSERT INTO Book0868skx (BKId, Titles, writers, PublicId, PubDate, ISBN, Prices, CategoryId)
VALUES
(3039, '民族的智慧', '佚名', 12, '2016-08-01', '978455964005', 45.64, 7),
(3939, '张骞的穿透力', '吉安', 13, '2018-11-22', '978465964084', 28.74, 8);
INSERT INTO BookType0868skx (CategoryId, bName)
VALUES
(4, '文学'),
(5, '艺术');
INSERT INTO Borrow0868skx(PID, BKID, BorrowDate, ReturnDate)
VALUES
(1002, 3039, '2020-08-04', '2020-10-14'),
(1002, 3939, '2019-04-04', '2019-05-14');
INSERT INTO Penalty0868skx (PID, BKID, PDate, PType, Amounts)
VALUES
(1002, 3039, '2020-10-14', 1, 4.44),
(1002, 3939, '2019-05-14', 2, 14.44);
4
DELETE FROM Penalty0868skx;
DELETE FROM Borrow0868skx;
DELETE FROM book0868skx;
DELETE FROM People0868skx;
DELETE FROM BookType0868skx;
DELETE FROM Publishers0868skx;
DELETE FROM PeopleType0868skx;
4-2
INSERT INTO PeopleType0868skx (PTId, PType, BNum)
VALUES
(101, '小学生', 3),
(102, '初中生', 5),
(103, '高中生', 7);
2025年12月29日 06点12分 7
level 1
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>用户登录</title>
<style>
/* 全局样式重置 + 背景 */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: "Microsoft Yahei", Arial, sans-serif;
}
body {
min-height: 100vh;
/* 渐变背景 */
background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
/* 居中登录框 */
display: flex;
justify-content: center;
align-items: center;
}
/* 登录卡片 */
.login-box {
background: #fff;
width: 380px;
padding: 40px;
border-radius: 15px;
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
/* 卡片轻微上浮动画 */
animation: float 3s ease-in-out infinite;
}
/* 标题 */
.login-title {
text-align: center;
font-size: 26px;
color: #333;
margin-bottom: 30px;
position: relative;
}
.login-title::after {
content: "";
width: 50px;
height: 4px;
background: #4facfe;
display: block;
margin: 10px auto 0;
border-radius: 2px;
}
/* 输入框组 - 新增提示容器样式 */
.input-group {
margin-bottom: 25px;
position: relative; /* 关键:让提示气泡相对于输入框定位 */
}
.input-group label {
display: block;
margin-bottom: 8px;
color: #555;
font-size: 15px;
}
.input-group input {
width: 100%;
height: 45px;
padding: 0 15px;
border: 1px solid #ddd;
border-radius: 8px;
font-size: 16px;
transition: all 0.3s;
outline: none;
}
/* 输入框聚焦效果 */
.input-group input:focus {
border-color: #4facfe;
box-shadow: 0 0 8px rgba(79, 172, 254, 0.3);
}
2026年04月27日 03点04分 8
level 1
.input-tip {
position: absolute;
top: -32px; /* 提示在输入框上方 */
left: 10px;
padding: 6px 12px;
background: linear-gradient(135deg,
#4facfe 0%, #
00f2fe 100%);
color: #fff;
font-size: 13px;
border-radius: 6px;
box-shadow: 0 2px 8px rgba(79, 172, 254, 0.4);
opacity: 0; /* 默认隐藏 */
visibility: hidden; /* 防止隐藏后占位置 */
transition: all 0.3s ease; /* 平滑过渡动画 */
z-index: 10;
}
/* 鼠标悬浮输入框,显示提示气泡 */
.input-group:hover .input-tip {
opacity: 1;
visibility: visible;
top: -38px; /* 轻微上移,更有动态感 */
}
2026年04月27日 03点04分 9
level 1
.input-tip::after {
content: "";
position: absolute;
bottom: -4px;
left: 20px;
width: 12px;
height: 12px;
background: #4facfe;
transform: rotate(45deg);
box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}
/* 按钮组 */
.btn-group {
display: flex;
justify-content: space-between;
margin-top: 10px;
}
.btn {
width: 48%;
height: 45px;
border: none;
border-radius: 8px;
font-size: 16px;
cursor: pointer;
transition: all 0.3s;
}
/* 登录按钮 */
.submit-btn {
background: linear-gradient(135deg, #4facfe, #00f2fe);
color: white;
}
/* 重置按钮 */
.reset-btn {
background: #f5f5f5;
color: #666;
}
.btn:hover {
transform: translateY(-2px);
box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
}
/* 卡片浮动动画 */
@keyframes float {
0%, 100% { transform: translateY(0); }
50% { transform: translateY(-8px); }
}
/* 小屏适配 */
@media (max-width: 450px) {
.login-box {
width: 90%;
padding: 30px 20px;
}
}
</style>
</head>
<body>
<div class="login-box">
<h2 class="login-title">用户登录</h2>
<form action="LoginServlet" method="post">
<!-- 用户名输入框 + 美化提示 -->
<div class="input-group">
<label>用户名</label>
<input type="text" name="username" placeholder="请输入用户名">
<div class="input-tip">请输入您的登录用户名</div>
</div>
<!-- 密码输入框 + 美化提示 -->
<div class="input-group">
<label>密码</label>
<input type="password" name="password" placeholder="请输入密码">
<div class="input-tip">请输入您的登录密码</div>
</div>
<div class="btn-group">
<input type="submit" class="btn submit-btn" value="登录">
<input type="reset" class="btn reset-btn" value="重置">
</div>
</form>
</div>
</body>
</html>
2026年04月27日 03点04分 10
level 1
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>系统首页</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
min-height: 100vh;
/* 升级高级冷色调渐变 */
background: linear-gradient(-45deg, #0f172a, #1e293b, #334155, #0ea5e9);
background-size: 400% 400%;
animation: bgMove 12s ease infinite;
display: flex;
justify-content: center;
align-items: center;
font-family: "Microsoft Yahei", sans-serif;
overflow: hidden;
}
/* 升级毛玻璃卡片 */
.text-box {
padding: 60px 100px;
background: rgba(255, 255, 255, 0.08);
backdrop-filter: blur(15px);
border-radius: 24px;
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
border: 1px solid rgba(255, 255, 255, 0.12);
}
/* 炫酷霓虹发光文字 */
.welcome-text {
font-size: 46px;
color: #ffffff;
letter-spacing: 8px;
font-weight: 600;
text-shadow: 0 0 10px #0ea5e9,
0 0 20px #38bdf8,
0 0 30px #7dd3fc;
animation: textShine 3s ease-in-out infinite;
white-space: nowrap;
}
@keyframes bgMove {
0% { background-position: 0% 50%; }
50% { background-position: 100% 50%; }
100% { background-position: 0% 50%; }
}
@keyframes textShine {
0%,100% {
opacity: 0.92;
transform: scale(1);
}
50% {
opacity: 1;
transform: scale(1.06);
}
}
/* 适配手机端 */
@media (max-width: 600px) {
.welcome-text {
font-size: 26px;
letter-spacing: 4px;
}
.text-box {
padding: 40px 40px;
}
}
</style>
</head>
<body>
<div class="text-box">
<div class="welcome-text">欢迎你进入本系统</div>
</div>
</body>
</html>
2026年04月27日 03点04分 11
level 1
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>出错了</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
min-height: 100vh;
background: linear-gradient(-45deg, #1a1a2e, #16213e, #0f3460, #192841);
background-size: 400% 400%;
animation: bgMove 12s ease infinite;
display: flex;
justify-content: center;
align-items: center;
font-family: "微软雅黑", sans-serif;
}
.error-box {
text-align: center;
padding: 60px 80px;
background: rgba(255, 255, 255, 0.08);
backdrop-filter: blur(12px);
border-radius: 20px;
border: 1px solid rgba(255, 255, 255, 0.15);
box-shadow: 0 8px 30px rgba(0,0,0,0.3);
}
.error-text {
font-size: 28px;
color: #ff6b6b;
letter-spacing: 2px;
margin-bottom: 35px;
text-shadow: 0 0 10px rgba(255, 107, 107, 0.6);
}
.back-btn {
display: inline-block;
padding: 12px 35px;
background: linear-gradient(90deg, #e74c3c, #c0392b);
color: #fff;
text-decoration: none;
border-radius: 30px;
font-size: 16px;
transition: all 0.3s ease;
box-shadow: 0 4px 15px rgba(231, 76, 60, 0.4);
}
.back-btn:hover {
transform: translateY(-3px);
box-shadow: 0 6px 20px rgba(231, 76, 60, 0.6);
}
@keyframes bgMove {
0%{background-position:0% 50%;}
50%{background-position:100% 50%;}
100%{background-position:0% 50%;}
}
@media (max-width: 500px) {
.error-box {
padding: 40px 30px;
}
.error-text {
font-size: 22px;
}
}
2026年04月27日 03点04分 12
level 1
package cn.js.czfy.jdxy.jy2432;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@WebServlet("/LoginServlet")
public class LoginServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
public LoginServlet() {
super();
}
// ✅ 所有逻辑都写在 doGet 里
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// 设置编码
request.setCharacterEncoding("UTF-8");
response.setContentType("text/html;charset=UTF-8");
// 获取账号密码
String username = request.getParameter("username");
String password = request.getParameter("password");
// 验证
if ("skx".equals(username) && "123456".equals(password)) {
response.sendRedirect("welcome.html"); // 成功
} else {
response.sendRedirect("error.html"); // 失败
}
}
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
doGet(request, response);
}
}
2026年04月27日 03点04分 14
level 1
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>出错了</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
min-height: 100vh;
/* 深色故障风渐变背景 */
background: linear-gradient(-45deg, #1a1a2e, #16213e, #0f3460, #192841);
background-size: 400% 400%;
animation: bgMove 12s ease infinite;
display: flex;
justify-content: center;
align-items: center;
font-family: "微软雅黑", sans-serif;
}
.error-box {
text-align: center;
padding: 60px 80px;
background: rgba(255, 255, 255, 0.08);
backdrop-filter: blur(12px);
border-radius: 20px;
border: 1px solid rgba(255, 255, 255, 0.15);
box-shadow: 0 8px 30px rgba(0,0,0,0.3);
}
.error-text {
font-size: 28px;
color: #ff6b6b;
letter-spacing: 2px;
margin-bottom: 35px;
text-shadow: 0 0 10px rgba(255, 107, 107, 0.6);
}
.back-btn {
display: inline-block;
padding: 12px 35px;
background: linear-gradient(90deg, #e74c3c, #c0392b);
color: #fff;
text-decoration: none;
border-radius: 30px;
font-size: 16px;
transition: all 0.3s ease;
box-shadow: 0 4px 15px rgba(231, 76, 60, 0.4);
}
2026年04月27日 03点04分 15
level 1
input[type="submit"] {
width: 100%;
padding: 13px;
background: linear-gradient(to right,
#43cea2, #
185a9d);
color: white;
border: none;
border-radius: 8px;
font-size: 16px;
font-weight: bold;
cursor: pointer;
transition: 0.3s;
}
input[type="submit"]:hover {
transform: translateY(-2px);
box-shadow: 0 5px 15px rgba(67,206,162,0.3);
}
.title {
text-align: center;
font-size: 24px;
color: #333;
margin-bottom: 25px;
font-weight: bold;
}




用户信息表单
用户名:
密    码:
性别:



兴趣爱好:
唱歌
跳舞
足球





form.htnl
2026年04月28日 03点04分 20
level 1
package cn.js.czfy.jdxy.jy2432;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@WebServlet("/RequestParamsServlet")
public class RequestParamsServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
public RequestParamsServlet() {
super();
}
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
request.setCharacterEncoding("utf-8");
response.setContentType("text/html;charset=utf-8");
PrintWriter out = response.getWriter();
// 获取表单数据
String username = request.getParameter("username");
String password = request.getParameter("pad");
String sex = request.getParameter("sex");
String[] hobbies = request.getParameterValues("hobby");
// 炫酷美化页面输出(渐变背景 + 卡片居中 + 阴影圆角)
out.println("");
out.println("");
out.println("");
out.println("");
out.println("提交结果");
out.println("");
out.println("*{margin:0;padding:0;box-sizing:border-box;font-family:'Microsoft YaHei',sans-serif;}");
out.println("body{background:linear-gradient(135deg,<a href="https://tieba.baidu.com/mo/q/hotMessage?topic_id=0&fid=202532&topic_name=43cea2,&is_video_topic=0">#43cea2,#</a>185a9d);min-height:100vh;display:flex;justify-content:center;align-items:center;}");
out.println(".card{background:white;padding:40px;border-radius:15px;box-shadow:0 10px 30px rgba(0,0,0,0.2);width:450px;text-align:center;}");
out.println("h2{color:#333;margin-bottom:25px;font-size:24px;}");
out.println("p{font-size:16px;color:#555;margin:12px 0;padding:10px;background:#f5f5f5;border-radius:8px;}");
out.println("");
out.println("");
out.println("");
out.println("");
out.println("✅ 个人信息提交成功");
2026年04月28日 03点04分 21
level 1
out.println("<p>用户名:" + (username == null ? "未填写" : username) + "</p>");
out.println("<p>密码:" + (password == null ? "未填写" : password) + "</p>");
out.println("<p>性别:" + (sex == null ? "未选择" : sex) + "</p>");
// 兴趣爱好拼接
String hobbyStr = "未选择";
if(hobbies != null && hobbies.length > 0) {
hobbyStr = String.join("    ", hobbies);
}
out.println("<p>兴趣爱好:" + hobbyStr + "</p>");
out.println("</div>");
out.println("</body>");
out.println("</html>");
}
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
doGet(request, response);
}
}
RequestParamsServlet
2026年04月28日 03点04分 22
level 1
input[type="submit"] {
width: 100%;
padding: 13px;
background: linear-gradient(to right,
#43cea2, #
185a9d);
color: white;
border: none;
border-radius: 8px;
font-size: 16px;
font-weight: bold;
cursor: pointer;
transition: 0.3s;
}
input[type="submit"]:hover {
transform: translateY(-2px);
box-shadow: 0 5px 15px rgba(67,206,162,0.3);
}
.title {
text-align: center;
font-size: 24px;
color: #333;
margin-bottom: 25px;
font-weight: bold;
}




用户信息表单
用户名:
密    码:
性别:



兴趣爱好:
唱歌
跳舞
足球





2026年04月28日 03点04分 23
1 2 尾页