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[] = ......
¡¶javaÓïÑÔ³ÌÐòÉè¼Æ£¨Ò»£©¡·2009Äê×Ôѧ¿¼ÊÔ´ó¸ÙµÚ4ÕÂ
www.wesiedu.com 2009-5-5 ÔÚÏßÄ£Ä⿼³¡
µÚ4Õ Êý×éºÍ×Ö·û´®
(Ò»)¿Î³ÌÄÚÈÝ
4.1 Êý×é
4.1.1 һάÊý×é
4.1.2 ¶àάÊý×é
4.2 ×Ö·û´®
4.2.1 ×Ö·û´®³£Á¿
4.2.2 ×Ö·û´®ÉùÃ÷ºÍ´´½¨
4.2.3 ×Ö·û´®»ù±¾²Ù×÷
4.2.4 StringTokenizerÀà
4.2.5×Ö· ......
¡¶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Ïß³Ìͬ²½
(¶þ)ѧϰĿµÄÓëÒªÇó
±¾Õ½éÉܶàÏ̵߳ĸÅÄîºÍ±àд¶àÏ̳߳ÌÐòµÄ·½·¨£¬ÊµÏÖÏß³ÌÖ®¼äÏ໥ͨÐźÍͬ²½µÄ¼¼ ......
/*
±¾¶Î´úÂëÔÚ¹«Ë¾ÏîÄ¿ÖÐʵ¼ÊÔ¶³Ìµ÷ÓõÚÈý·½¹«Ë¾ÌṩµÄC#¿ª·¢WebServiceµÄʾÀý
*/
/**
* µÇ¼ÓÎÏ·
*
* @param paramPN
* @param paramTerraceID
* @param paramSvrID
*/
private String loginGame(String paramPN, HttpServletRequest req){
&n ......