📄 example4_6.jsp
字号:
<%@page contentType="text/html;charset=gb2312"%>
<%@page import="java.io.*" %>
<html>
<body>
<font color="red" size="3">
<%
File f=new File("C:/Program Files/Apache Software Foundation/Tomcat 6.0/bin","hello.txt");
try{
FileOutputStream outfile=new FileOutputStream(f);
BufferedOutputStream bufferout=new BufferedOutputStream(outfile);
byte b[]="你们好,很高兴认识你们呀!<br>Nice to meet you!".getBytes();
bufferout.write(b);
bufferout.flush();
bufferout.close();
outfile.close();
FileInputStream in=new FileInputStream(f);
BufferedInputStream bufferin=new BufferedInputStream(in);
byte c[]=new byte[90];
int n=0;
while((n=bufferin.read(c))!=-1){
String temp=new String(c,0,n);
out.print(temp);
}
bufferin.close();
in.close();
}catch(IOException e){
}
%>
</font>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -