⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ok_modify.jsp

📁 中学教学管理系统
💻 JSP
字号:
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>修改成功</title>
</head>

<body>
<%@ page language="java" import="java.io.*"%>
<p>
<% String sel= new String(request.getParameter("sel"));
   int a = new Integer(sel).intValue();
   String user= new String(request.getParameter("user"));
   String content= new String(request.getParameter("content"));
   try{
       int i=0;
	   String record = new String();
	   String all[] = new String [100]; 
	   String address = application.getRealPath("sourceofteach");
       RandomAccessFile ct = new RandomAccessFile(address+"/"+"content.txt","rw");
	   while((record = ct.readLine()) != null){
	      i++;
		  all[i]=record;
	   }
	   ct.close();
	   all[a] = user+":"+content;
	   File file = new File(address+"/"+"content.txt");
	   file.delete();
	   RandomAccessFile ct1 = new RandomAccessFile(address+"/"+"content.txt","rw");
	   int j=1;
	   while(j<=i){
	   ct1.writeBytes(all[j]+"\n");
	   j++;
	   }
	   ct1.close();
	   out.println("您输入的修改信息为:"+"<br>");
	   out.println(a+"--"+new String(user.getBytes("8859_1"))+":"+new String(content.getBytes("8859_1"))+"<br>");
	   out.println("资源信息保存成功"+"<br>");
   }catch(Exception e){}
%>
</p>
<p>
<form action="modify.jsp">
  <input type="submit" value="继续修改">&nbsp;&nbsp;
  <input type="button" value="关闭" onClick="javascript:window.close();">
</form>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -