java ÎļþµÄ¶Áд,×·¼Ó
дÈë¶Á³ö
String num = request.getParameter("num");
String sessionId = request.getParameter("s") + ";" + num + "\n";
File writefile;
try{
String path = "tt.txt";
writefile = new File(path);
if (writefile.exists() == false) {
writefile.createNewFile();
writefile = new File(path); // ÖØÐÂʵÀý»¯
}
FileOutputStream fos = new FileOutputStream(writefile);
out.println("###content:" + sessionId);
fos.write(sessionId.getBytes());
fos.flush();
fos.close();
byte[] b = new byte[17*1024];
FileInputStream fis = new FileInputStream(writefile);
fis.read(b);
String s = new String(b);
out.println(s);
fis.close();
}catch(Exception ex){
System.out.println(ex.getMessage());
}
×·¼Ó:
String path=request.getRealPath(".");
RandomAccessFile rf=new RandomAccessFile("WriteData.txt","rw");//¶¨ÒåÒ»¸öÀàRandomAccessFileµÄ¶ÔÏ󣬲¢ÊµÀý»¯
rf.seek(rf.length());//½«Ö¸ÕëÒÆ¶¯µ½Îļþĩβ
rf.writeBytes("\nAppend a line to the file!");
rf.close();//¹Ø±ÕÎļþÁ÷
out.println("дÈëÎļþÄÚÈÝΪ£º£¼br>");
FileReader fr=new FileReader(path + "\\WriteData.txt");
BufferedReader br=new BufferedReader(fr);//¶ÁÈ¡ÎļþµÄBufferedRead¶ÔÏó
String Line=br.readLine();
while(Line!=null){
out.println(Line + "£¼br>");
Line=br.readLine();
}
fr.close();//¹Ø±ÕÎļþ
Ïà¹ØÎĵµ£º
ÓÐ600¸öÆ»¹û£¬10¸öºÐ×Ó£¬ÒªÇó°Ñ600¸öÆ»¹û·Ö×°µ½10¸öºÐ×ÓÀï¡£Èç¹ûÓÐÈËÀ´ÂòÆ»¹ûËæ±ã˵³öÒ»¸öÊý£¬Ö±½ÓÄÃÕâЩºÐ×Ó×éװһϾͿÉÒÔ¸øËû²»Óòð·ÖºÐ×Ó¡£ÇëÎÊÕâ10¸öºÐ×ÓÓ¦¸Ã·Ö±ð×°¶àÉÙÆ»¹û£¿
´úÂëÈçÏÂ
import java.util.Scanner;
public class Test {
public static void main(String[] args) {
int box[] = ......
//µ÷Óô洢¹ý³Ì´ø²Î
CallableStatement ca = conn.prepareCall("{call Login (?,?)}");
ca.setString(1,username);
& ......
¡¶javaÓïÑÔ³ÌÐòÉè¼Æ£¨Ò»£©¡·2009Äê×Ôѧ¿¼ÊÔ´ó¸ÙµÚ6ÕÂ
www.wesiedu.com 2009-5-5 ÔÚÏßÄ£Ä⿼³¡
µÚ6Õ ͼÐνçÃæÉè¼Æ(¶þ)
(Ò»)¿Î³ÌÄÚÈÝ
6.1Ñ¡Ôñ¿òºÍµ¥Ñ¡°´Å¥
6.1.1Ñ¡Ôñ¿ò
6.1.2µ¥Ñ¡¿ò
6.1.3µ¥Ñ¡°´Å¥
6.1.4Ñ¡ÔñÏîĿʼþ´¦Àí
6.2ÁбíºÍ×éºÏ¿ò
6.2.1Áбí
6.2.2×éºÏ¿ò
6.3²Ëµ¥
6.3.1²Ëµ¥Ìõ¡ ......
¡¶javaÓïÑÔ³ÌÐòÉè¼Æ£¨Ò»£©¡·2009Äê×Ôѧ¿¼ÊÔ´ó¸ÙµÚ7ÕÂ
www.wesiedu.com 2009-5-5 ÔÚÏßÄ£Ä⿼³¡
µÚ7Õ ͼÐΡ¢Í¼ÏñÓë¶àýÌå
(Ò»)¿Î³ÌÄÚÈÝ
7.1 »æÍ¼»ù´¡
7.1.1 GraphicsÀàµÄ»ù±¾¹¦ÄÜ
7.1.2×ÖÐͺÍÑÕÉ«
7.1.3»æÍ¼Ä£Ê½
7.2»æÍ¼
7.2.1 GâîphicsÀàµÄ»æÍ¼·½·¨
7.2.2 Gmphics2DÀàµÄ»æÍ¼·½·¨
7.3ͼ ......
µÚ8Õ ¶àÏß³Ì
(Ò»)¿Î³ÌÄÚÈÝ
8.1Ï̵߳Ļù±¾¸ÅÄî
8.1.1Ï̵߳ÄÉúÃüÖÜÆÚ
8.1.2Ï̵߳÷¶ÈÓëÓÅÏȼ¶
8.2 ThreadÀàºÍRunnable½Ó13
8.2.1 ThreadÀà
8.2.2 Runnable½Ó¿Ú
8.3Ï̻߳¥³âºÍͬ²½
8.3.1Ï̻߳¥³â
8.3.2Ïß³Ìͬ²½
(¶þ)ѧϰĿµÄÓëÒªÇó
±¾Õ½éÉܶàÏ̵߳ĸÅÄîºÍ±àд¶àÏ̳߳ÌÐòµÄ·½·¨£¬ÊµÏÖÏß³ÌÖ®¼äÏ໥ͨÐźÍͬ²½µÄ¼¼ ......