javaweb添加学生信息
连接数据库已经进行判断
要求:
1登录账号:要求由6到12位字母、数字、下划线组成,只有字母可以开头;(1分)
2登录密码:要求显示“• ”或“*”表示输入位数,密码要求八位以上字母、数字组成。(1分)
3性别:要求用单选框或下拉框实现,选项只有“男”或“女”;(1分)
4学号:要求八位数字组成,前四位为“2018”开头,输入自己学号;(1分)
5姓名:输入自己的姓名;
5电子邮箱:要求判断正确格式xxxx@xxxx.xxxx;(1分)
6点击“添加”按钮,将学生个人信息存储到数据库中。(3分)
7可以演示连接上数据库。(2分)
DBUtil.java文件
<%@ page language="java" contentType="text/html; charset=utf-8"
pageEncoding="utf-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Insert title here</title>
</head>
<body>
<!-- onsubmit="return chack()" -->
<form action="UserServlet?method=add" method="post" onsubmit="return chack()" >
<%
Object message = request.getAttribute("message");//放置一个字符串,并取出
if(message!=null && !"".equals(message)){ %>
<script type="text/javascript">
alert("<%=request.getAttribute("message")%>");
</script>
<%} %>
账户:<input type="text" id="zhanghu" name="zhanghu" placeholder="请输入账户名" onblur="checkZhanghao()" /><br><br>
<span style="font-size:13px" id="zhanghuspan"></span> <!-- <script type="text/javascript">
function limit1(value)
{
var phone = value;
var w=phone.length;
if(w<6||w>12)
{
alert("账号位数非法,确定后重新输入...");
document.all.phone.value = "";
document.all.phone.focus();
return false;
}
else
{
for(var a=0;a<w;a++)
{
if(phone.charAt[a]=="_")
{
continue;
}
if(phone.charAt[a]>=48&&phone.charAt[a]<=57)
{
continue;
}
if(phone.charAt[a]>=65&&phone.charAt[a]<=90)
{
continue;
}
if(phone.charAt[a]>=97&&phone.charAt[a]<=122)
{
continue;
} }
}
}
</script>
--> 密码:<input type="password" id="psw" name="psw" placeholder="请输入密码" onblur="checkPassword()" /><br><br>
<span style="font-size:13px" id="pswspan"></span> 性别:<select id="sex" name="sex">
<option>男</option>
<option>女</option>
</select>
<br><br>
姓名:<input type="text" id="name" name="name" placeholder="请输入姓名" /><br><br>
<!-- 性别:<input type="radio" id="usersex" name="usersex" value="男" checked="checked" />男
<input type="radio" name="usersex" value="女" />女
<br><br>-->
学号:<input type="text" id="xuehao" name="xuehao" placeholder="请输入学号" onblur="checkId()" /><br><br>
<span style="font-size:13px" id="xuehaospan"></span> 邮箱:<input type="email" id="mail" name="mail" placeholder="请输入邮箱" /><br><br> 所在学院:<input type="text" id="xueyuan" name="xueyuan" placeholder="请输入学院" /><br><br> 所在系:<input type="text" id="xi" name="xi" placeholder="请输入所在系" /><br><br> 所在班级:<input type="text" id="class1" name="class1" placeholder="请输入所在班级" /><br><br> 入学年份:<select id="year" name="year">
<option>1998</option>
<option>1999</option>
<option>2000</option>
<option>2001</option>
<option>2002</option>
<option>2003</option>
<option>2004</option>
<option>2005</option>
<option>2006</option>
<option>2007</option>
<option>2008</option>
<option>2009</option>
<option>2010</option>
<option>2011</option>
<option>2012</option>
<option>2013</option>
<option>2014</option>
<option>2015</option>
<option>2016</option>
<option>2017</option>
<option>2018</option>
<option>2019</option>届
</select>
<br><br> 所在生源地:<input type="text" id="sheng" name="sheng" placeholder="请输入所在生源地" /><br><br> 备注:<input type="text" id="beizhu" name="beizhu" placeholder="请输入备注" /><br><br> <input type="submit" value="添加">
<input type="reset" value="重置"> <!-- 手机号:<input type="text" id="userphone" name="userphone" maxlength="11" onkeyup="this.value=this.value.replace(/\D/g,'')" placeholder="请输入手机号" onblur="limit(this.value)"/> <script language="javaScript">
function limit(value){
var phone = value;
var reg = /[1][3,4,5,7,8]+[0-9]{9}/; if(phone.length != 11 || reg.test(phone) == false){
alert("输入的手机号非法,确定后重新输入...");
document.all.phone.value = "";
document.all.phone.focus();
return false;
}
}
</script>
-->
<br/>
<br/> <script type="text/javascript">
//重置按钮处添加onclick调用formReset %>
function checkZhanghao()
{
var zhanghao = document.getElementById("zhanghu");
var zhanghao1=zhanghao.value;
var spanNode = document.getElementById("zhanghuspan");
//编写邮箱的正则
var reg = /^[a-z][a-z0-9A-Z]{6}/;
if(reg.test(zhanghao1)){
//符合规则
spanNode.innerHTML = "".fontcolor("green");
return true;
}else{
//不符合规则
alert('账户格式错误');
zhanghao.value = "";
zhanghao.focus();
return false;
}
} function checkPassword()
{
var password = document.getElementById("psw");
if((password.value).length!=8){
alert('密码应为8位英文或数字');
userpsw.focus();
return false;
}
} function checkId()
{
var id = document.getElementById("xuehao").value;
var spanNode = document.getElementById("xuehaospan");
//学号的正确形式
// var reg = /^[0-9a-zA-Z]{6}/;
if((id<"20180000")|| (id>"20189999"))
{
spanNode.innerHTML = "学号格式不正确,请重新填写!".fontcolor("red");
return false;
}
else{
//不符合规则
spanNode.innerHTML = "".fontcolor("green");
return true;
}
} </script> <script type="text/javascript">
function chack1() {
var zhanghu1=document.getElementById("zhanghu");
var psw1=document.getElementById("psw"); var xuehao1=document.getElementById("xuehao"); var xi=document.getElementById("xi");
var class1=document.getElementById("class1");
var year=document.getElementById("year");
var sheng=document.getElementById("sheng");
var beizhu=document.getElementById("beizhu"); var zhanghu=zhanghu1.value;
var xuehao=xuehao1.value;
var psw=pse1.value;
var zhi;
var xue;
var wen;
wen=xuehao.value.length();
xue=zhanghu.value.length();
zhi=psw.value.length();
if(xue<6||xue>12)
{
alert("账号位数错误");
zhanghu.focus();
return false;
}
for(var a=0;a<xue;a++)
{
if(zhanghu.charAt[a]="_")
{
alert("账号类型错误");
zhanghu.focus();
return false;
}
if(zhanghu.value.charAt[a]>=48&&zhanghu.charAt[a]<=57)
{
continue;
}
if(zhanghu.charAt[a]>=65&&zhanghu.charAt[a]<=90)
{
continue;
}
if(zhanghu.charAt[a]>=97&&zhanghu.charAt[a]<=122)
{
continue;
} alert("账号类型错误");
zhanghu.focus();
return false;
} if(zhi<8)
{
alert("密码位数错误");
psw.focus();
return false;
}
for(var b=0;b<zhi;b++)
{
if(psw.charAt[b]>=48&&psw.charAt[b]<=57)
{
continue;
} if(psw.charAt[b]>=65&&psw.charAt[b]<=90)
{
continue;
}
if(psw.charAt[b]>=97&&psw.charAt[b]<=122)
{
continue;
}
alert("密码类型错误");
psw.focus();
return false;
} if(wen!=8)
{
alert("学号位数错误");
xuehao.focus();
return false;
}
if(xuehao.charAt[0]!=2||xuehao.charAt[1]!=0||xuehao.charAt[2]!=1||xuehao.charAt[3]!=8)
{
alert("学号开头不是2018");
xuehao.focus();
return false;
} }
} </script>
</form>
</body>
</html>
User.servlet
package servlet; 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;
import javax.swing.JOptionPane; import com.newjavaweb.User;
import Dao.userdao; /**
* Servlet implementation class UserServlet
*/
@WebServlet("/UserServlet")
public class UserServlet extends HttpServlet {
private static final long serialVersionUID = 1L; /**
* @see HttpServlet#HttpServlet()
*/
public UserServlet() {
super();
// TODO Auto-generated constructor stub
}
userdao dao = new userdao(); protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
req.setCharacterEncoding("utf-8");
String method = req.getParameter("method");
if ("add".equals(method)) {
add(req, resp);
} else if ("search".equals(method)) {
search(req, resp);
}
} private void search(HttpServletRequest req, HttpServletResponse resp) throws IOException, ServletException {
// TODO Auto-generated method stub
req.setCharacterEncoding("utf-8"); String zhanghu = req.getParameter("zhanghu");
String psw = req.getParameter("psw");
String rpassword = dao.search(zhanghu); if(psw.equals(rpassword)) {
//JOptionPane.showMessageDialog(null,"登陆成功!");
req.setAttribute("message", "登陆成功!");
req.getRequestDispatcher("NewFile.jsp").forward(req,resp);
}
else {
//JOptionPane.showMessageDialog(null,"账号不存在或密码错误!");
req.setAttribute("message", "账号不存在或密码错误!");
req.getRequestDispatcher("login.jsp").forward(req,resp);
} }
private void add(HttpServletRequest req, HttpServletResponse resp) throws IOException, ServletException {
// TODO Auto-generated method stub
String zhanghu = req.getParameter("zhanghu");
String psw = req.getParameter("psw");
String sex=req.getParameter("sex");
String name=req.getParameter("name");
String xuehao=req.getParameter("xuehao");
String mail=req.getParameter("mail");
String xueyuan=req.getParameter("xueyuan");
String xi=req.getParameter("xi");
String class1=req.getParameter("class1");
String year=req.getParameter("year");
String sheng=req.getParameter("sheng");
String beizhu=req.getParameter("beizhu"); User user= new User(zhanghu,psw,sex,name,xuehao,mail,xueyuan,xi,class1,year,sheng,beizhu); String rusername = dao.find(zhanghu); if(!zhanghu.equals(rusername)) {
dao.add(user); req.setAttribute("message", "添加成功!");
req.getRequestDispatcher("login.jsp").forward(req, resp);
}else { req.setAttribute("message", "账户重复,请重新输入!");
req.getRequestDispatcher("zc.jsp").forward(req, resp);
}
} }
usedao.java
package Dao; import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement; import util.DBUtil;
import com.newjavaweb.User; public class userdao {
public boolean add(User user) {
String sql = "insert into text(zhanghu,psw,sex,name,xuehao,mail,xueyuan,xi,class1,year,sheng,beizhu)"
+ "values('" + user.getZhanghu() + "','" + user.getPsw()+ "','" + user.getSex() + "','" + user.getName()+ "','" + user.getXuehao()+ "','" + user.getMail()+ "','" + user.getXueyuan()+ "','" + user.getXi()+ "','" + user.getClass1()+ "','" + user.getYear()+ "','" + user.getSheng()+ "','" + user.getBeizhu()+ "')";
Connection conn = DBUtil.getConn();//调用方法连接数据库
Statement state = null;
boolean f = false;
int a = 0 ; try { //监视大括号内的代码
state = conn.createStatement();
a = state.executeUpdate(sql);
} catch (Exception e) { //捕获错误
e.printStackTrace();
} finally {
//关闭z 连接
DBUtil.close(state, conn);
} if (a > 0) {
f = true;
}
return f;
}
public String find(String zhanghu)
{
String sql = "select * from text where ";
if (zhanghu!= "") {
sql += "zhanghu like '%" + zhanghu + "%'";
}
Connection conn = DBUtil.getConn();
Statement state = null;
ResultSet rs = null;
String username2 = null;
try {
state = conn.createStatement();
rs = state.executeQuery(sql);
while (rs.next()) { username2 = rs.getString("zhanghu"); }
} catch (SQLException e) {
e.printStackTrace();
} finally {
DBUtil.close(rs, state, conn);
}
return username2;
} public String search(String zhanghu) {
String sql = "select * from text where ";
if (zhanghu!= "") {
sql += "zhanghu like '%" + zhanghu + "%'";
} Connection conn = DBUtil.getConn();
Statement state = null;
ResultSet rs = null;
String password2 = null;
try {
state = conn.createStatement();
rs = state.executeQuery(sql);
while (rs.next()) { password2 = rs.getString("psw"); }
} catch (SQLException e) {
e.printStackTrace();
} finally {
DBUtil.close(rs, state, conn);
} return password2;
} }
User.java
package com.newjavaweb;
public class User {
private String zhanghu;
private String psw;
private String sex;
private String name;
private String xuehao;
private String mail;
private String xueyuan;
private String xi;
private String class1;
private String year;
private String sheng;
private String beizhu;
public String getZhanghu() {
return zhanghu;
}
public void setZhanghu(String zhanghu) {
this.zhanghu = zhanghu;
}
public String getPsw() {
return psw;
}
public void setPsw(String psw) {
this.psw = psw;
}
public String getSex() {
return sex;
}
public void setSex(String sex) {
this.sex = sex;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getXuehao() {
return xuehao;
}
public void setXuehao(String xuehao) {
this.xuehao = xuehao;
}
public String getMail() {
return mail;
}
public void setMail(String mail) {
this.mail = mail;
}
public String getXueyuan() {
return xueyuan;
}
public void setXueyuan(String xueyuan) {
this.xueyuan = xueyuan;
}
public String getXi() {
return xi;
}
public void setXi(String xi) {
this.xi = xi;
}
public String getClass1() {
return class1;
}
public void setClass1(String class1) {
this.class1 = class1;
}
public String getYear() {
return year;
}
public void setYear(String year) {
this.year = year;
}
public String getSheng() {
return sheng;
}
public void setSheng(String sheng) {
this.sheng = sheng;
}
public String getBeizhu() {
return beizhu;
}
public void setBeizhu(String beizhu) {
this.beizhu = beizhu;
}
public User(String zhanghu, String psw, String sex, String name, String xuehao, String mail, String xueyuan,
String xi, String class1, String year, String sheng, String beizhu) {
super();
this.zhanghu = zhanghu;
this.psw = psw;
this.sex = sex;
this.name = name;
this.xuehao = xuehao;
this.mail = mail;
this.xueyuan = xueyuan;
this.xi = xi;
this.class1 = class1;
this.year = year;
this.sheng = sheng;
this.beizhu = beizhu;
}
}
zc.jsp
<%@ page language="java" contentType="text/html; charset=utf-8"
pageEncoding="utf-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Insert title here</title>
</head>
<body>
<!-- onsubmit="return chack()" -->
<form action="UserServlet?method=add" method="post" onsubmit="return chack()" >
<%
Object message = request.getAttribute("message");//放置一个字符串,并取出
if(message!=null && !"".equals(message)){ %>
<script type="text/javascript">
alert("<%=request.getAttribute("message")%>");
</script>
<%} %>
账户:<input type="text" id="zhanghu" name="zhanghu" placeholder="请输入账户名" onblur="checkZhanghao()" /><br><br>
<span style="font-size:13px" id="zhanghuspan"></span> <!-- <script type="text/javascript">
function limit1(value)
{
var phone = value;
var w=phone.length;
if(w<6||w>12)
{
alert("账号位数非法,确定后重新输入...");
document.all.phone.value = "";
document.all.phone.focus();
return false;
}
else
{
for(var a=0;a<w;a++)
{
if(phone.charAt[a]=="_")
{
continue;
}
if(phone.charAt[a]>=48&&phone.charAt[a]<=57)
{
continue;
}
if(phone.charAt[a]>=65&&phone.charAt[a]<=90)
{
continue;
}
if(phone.charAt[a]>=97&&phone.charAt[a]<=122)
{
continue;
} }
}
}
</script>
--> 密码:<input type="password" id="psw" name="psw" placeholder="请输入密码" onblur="checkPassword()" /><br><br>
<span style="font-size:13px" id="pswspan"></span> 性别:<select id="sex" name="sex">
<option>男</option>
<option>女</option>
</select>
<br><br>
姓名:<input type="text" id="name" name="name" placeholder="请输入姓名" /><br><br>
<!-- 性别:<input type="radio" id="usersex" name="usersex" value="男" checked="checked" />男
<input type="radio" name="usersex" value="女" />女
<br><br>-->
学号:<input type="text" id="xuehao" name="xuehao" placeholder="请输入学号" onblur="checkId()" /><br><br>
<span style="font-size:13px" id="xuehaospan"></span> 邮箱:<input type="email" id="mail" name="mail" placeholder="请输入邮箱" /><br><br> 所在学院:<input type="text" id="xueyuan" name="xueyuan" placeholder="请输入学院" /><br><br> 所在系:<input type="text" id="xi" name="xi" placeholder="请输入所在系" /><br><br> 所在班级:<input type="text" id="class1" name="class1" placeholder="请输入所在班级" /><br><br> 入学年份:<select id="year" name="year">
<option>1998</option>
<option>1999</option>
<option>2000</option>
<option>2001</option>
<option>2002</option>
<option>2003</option>
<option>2004</option>
<option>2005</option>
<option>2006</option>
<option>2007</option>
<option>2008</option>
<option>2009</option>
<option>2010</option>
<option>2011</option>
<option>2012</option>
<option>2013</option>
<option>2014</option>
<option>2015</option>
<option>2016</option>
<option>2017</option>
<option>2018</option>
<option>2019</option>届
</select>
<br><br> 所在生源地:<input type="text" id="sheng" name="sheng" placeholder="请输入所在生源地" /><br><br> 备注:<input type="text" id="beizhu" name="beizhu" placeholder="请输入备注" /><br><br> <input type="submit" value="添加">
<input type="reset" value="重置"> <!-- 手机号:<input type="text" id="userphone" name="userphone" maxlength="11" onkeyup="this.value=this.value.replace(/\D/g,'')" placeholder="请输入手机号" onblur="limit(this.value)"/> <script language="javaScript">
function limit(value){
var phone = value;
var reg = /[1][3,4,5,7,8]+[0-9]{9}/; if(phone.length != 11 || reg.test(phone) == false){
alert("输入的手机号非法,确定后重新输入...");
document.all.phone.value = "";
document.all.phone.focus();
return false;
}
}
</script>
-->
<br/>
<br/> <script type="text/javascript">
//重置按钮处添加onclick调用formReset %>
function checkZhanghao()
{
var zhanghao = document.getElementById("zhanghu");
var zhanghao1=zhanghao.value;
var spanNode = document.getElementById("zhanghuspan");
//编写邮箱的正则
var reg = /^[a-z][a-z0-9A-Z]{6}/;
if(reg.test(zhanghao1)){
//符合规则
spanNode.innerHTML = "".fontcolor("green");
return true;
}else{
//不符合规则
alert('账户格式错误');
zhanghao.value = "";
zhanghao.focus();
return false;
}
} function checkPassword()
{
var password = document.getElementById("psw");
if((password.value).length!=8){
alert('密码应为8位英文或数字');
userpsw.focus();
return false;
}
} function checkId()
{
var id = document.getElementById("xuehao").value;
var spanNode = document.getElementById("xuehaospan");
//学号的正确形式
// var reg = /^[0-9a-zA-Z]{6}/;
if((id<"20180000")|| (id>"20189999"))
{
spanNode.innerHTML = "学号格式不正确,请重新填写!".fontcolor("red");
return false;
}
else{
//不符合规则
spanNode.innerHTML = "".fontcolor("green");
return true;
}
} </script> <script type="text/javascript">
function chack1() {
var zhanghu1=document.getElementById("zhanghu");
var psw1=document.getElementById("psw"); var xuehao1=document.getElementById("xuehao"); var xi=document.getElementById("xi");
var class1=document.getElementById("class1");
var year=document.getElementById("year");
var sheng=document.getElementById("sheng");
var beizhu=document.getElementById("beizhu"); var zhanghu=zhanghu1.value;
var xuehao=xuehao1.value;
var psw=pse1.value;
var zhi;
var xue;
var wen;
wen=xuehao.value.length();
xue=zhanghu.value.length();
zhi=psw.value.length();
if(xue<6||xue>12)
{
alert("账号位数错误");
zhanghu.focus();
return false;
}
for(var a=0;a<xue;a++)
{
if(zhanghu.charAt[a]="_")
{
alert("账号类型错误");
zhanghu.focus();
return false;
}
if(zhanghu.value.charAt[a]>=48&&zhanghu.charAt[a]<=57)
{
continue;
}
if(zhanghu.charAt[a]>=65&&zhanghu.charAt[a]<=90)
{
continue;
}
if(zhanghu.charAt[a]>=97&&zhanghu.charAt[a]<=122)
{
continue;
} alert("账号类型错误");
zhanghu.focus();
return false;
} if(zhi<8)
{
alert("密码位数错误");
psw.focus();
return false;
}
for(var b=0;b<zhi;b++)
{
if(psw.charAt[b]>=48&&psw.charAt[b]<=57)
{
continue;
} if(psw.charAt[b]>=65&&psw.charAt[b]<=90)
{
continue;
}
if(psw.charAt[b]>=97&&psw.charAt[b]<=122)
{
continue;
}
alert("密码类型错误");
psw.focus();
return false;
} if(wen!=8)
{
alert("学号位数错误");
xuehao.focus();
return false;
}
if(xuehao.charAt[0]!=2||xuehao.charAt[1]!=0||xuehao.charAt[2]!=1||xuehao.charAt[3]!=8)
{
alert("学号开头不是2018");
xuehao.focus();
return false;
} }
} </script>
</form>
</body>
</html>
javaweb添加学生信息的更多相关文章
- 从C#中通过Windows窗体添加信息到数据库 (添加学生信息)
如上图所示界面,当我们点击保存按钮时将会将表格中的数据保存到数据库中去,与数据库进行一个交互 第一步我们就是要获取到表格中的数据 string pwd = textpwd.Text; //获得第一次输 ...
- MVC学生管理系统-阶段II(添加学生信息)
项目源码 :https://download.csdn.net/download/weixin_44718300/11091042 前期准备,主体框架,学生列表显示 请看上一篇文章 本文是对阶段 ...
- javaweb之添加学生信息
1登录账号:要求由6到12位字母.数字.下划线组成,只有字母可以开头:(1分) 2登录密码:要求显示“• ”或“*”表示输入位数,密码要求八位以上字母.数字组成.(1分) 3性别:要求用单选框或下拉框 ...
- 添加学生信息(Javaweb)
add.jsp <%@ page language="java" import="java.util.*" pageEncoding="UTF- ...
- java7连接数据库 网页 添加学生信息测试
石家庄铁道大学2019年秋季 2018 级课堂测试试卷(六)(10分) 课程名称: JAVA语言程序设计 任课教师: 王建民 考试时间: 150 分钟 一. 考试要求: 1登录账号 ...
- 添加学生信息(java wb)
要求: 1.登录账号:要求由6到12位字母.数字.下划线组成,只有字母可以开头: 2.登录密码:要求显示“• ”或“*”表示输入位数,密码要求八位以上字母.数字组成: 3.性别:要求用单选框或下拉框实 ...
- web添加学生信息(首发web)
程序思路,先在JSP上画好页面,然后再创建一Servlet文件用于判断在网页上操作是否正确,还需要与数据库相连接,用DBUtile文件连接数据库,用Dao层来实现数据的增加,用Service来服务于D ...
- 向数据库添加学生信息。存放在REQUEST对象里
代码前几天已经发过了,但是程序一直还没运行出来,今天重新建立了一个数据库,才可以,下面补充上数据截图
- javeweb_学生信息添加系统
在text.jsp中画出界面,以及设置提交选项的限制 <%@ page language="java" contentType="text/html; charse ...
随机推荐
- C语言程序设计(七) 函数
第七章 函数 分而治之: 把较大的任务分解成若干较小.较简单的任务,并提炼出公用任务的方法 函数是C语言中模块化程序设计的最小单位,既可以把每个函数都看作一个模块,也可以将若干相关的函数合并成一个模块 ...
- 基于kylinTOP工具的HTTP2压力测试
1.HTTP协议概述 说到http,那就应该先了解一下http协议的发展历史.关于http协议的历史,可以参考阮一峰老师的这篇博客文章HTTP 协议入门,里面介绍的比较详细了.简单来说http先后存在 ...
- git删除已经提交的包含敏感信息的文件(还没提交到远程仓库)
写好的代码已经提交了(但还没push到github),发现某个文件里包含密码.如果push的话,密码可就被公开了.如果在代码里改掉密码,再commit一次,也不行,历史提交记录还是会上传到github ...
- hdu(杭电oj)输入输出练习题目总结
1000.1001 .1089.1090.1091.1092.1093.1094.1095.1096
- 普通人学习rust——从零到放弃 变量、不可变量、常量
普通人学习rust--从零到放弃 变量.不可变量.常量 环境 本文章内容基于如下环境,如若出入请参考当前环境. rustc 1.42.0 (b8cedc004 2020-03-09) cargo 1. ...
- 使用WireShark进行网络流量安全分析
WireShark的过滤规则 伯克利包过滤(BPF)(应用在wireshark的捕获过滤器上) ** 伯克利包过滤中的限定符有下面的三种:** Type:这种限定符表示指代的对象,例如IP地址,子网或 ...
- 强连通分量SCC 2-SAT
强连通分量SCC 2-SAT 部分资料来自: 1.https://blog.csdn.net/whereisherofrom/article/details/79417926 2.https://ba ...
- 构建安全可靠的微服务 | Nacos 在颜铺 SaaS 平台的应用实践
作者 | 殷铭 颜铺科技架构师 本文整理自架构师成长系列 3 月 19 日直播课程. 关注"阿里巴巴云原生"公众号,回复 "319",即可获取对应直播回放链接 ...
- TensorFlow v2.0实现逻辑斯谛回归
使用TensorFlow v2.0实现逻辑斯谛回归 此示例使用简单方法来更好地理解训练过程背后的所有机制 MNIST数据集概览 此示例使用MNIST手写数字.该数据集包含60,000个用于训练的样本和 ...
- 「MoreThanJava」当大学选择了计算机之后应该知道的
「MoreThanJava」 宣扬的是 「学习,不止 CODE」,本系列 Java 基础教程是自己在结合各方面的知识之后,对 Java 基础的一个总回顾,旨在 「帮助新朋友快速高质量的学习」. 当然 ...