javaºÍphpÎļþ¶Áд¶Ô±È¾ÙÀý¼°½â¾öÈÃÈËÍ·Í´µÄÂÒÂëÎÊÌâ
JAVAÎļþ¶Áд±ØÐëҪעÒâ±àÂëÎÊÌâ
javaµÄÎļþд
Ö±½ÓʹÓÃFileWriter¼´¿É£¬µÚ¶þ¸ö²ÎÊýΪ׷¼ÓдÈ룬ĬÈÏÊǸ²¸Çд¡£Ð´Íê±ØÐëclose²Å»á±£´æÐ´ºÃµÄÄÚÈÝ¡£
ĬÈÏÇé¿öÈç¹ûûÓлáн¨Ò»¸öÎļþ
FileWriter fw = null;
try {
fw = new FileWriter("/data/updatetime.dat", true); // true×·¼ÓдÈë
fw.append(message + "\n\r");
} catch (IOException e) {
e.printStackTrace();
} finally {
if (fw != null) {
try {
fw.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
javaµÄÎļþ¶Á
FileReaderÖ±½Ó¶ÁÖÐÎÄ»áÓÐÂÒÂëÎÊÌâ
FileReader fr = new FileReader("/data/updatetime.dat");
char[] data = new char[1024];
int num = fr.read(data);
String result = new String(data, 0, num);
//ÕâÀï»á²úÉúÂÒÂëÎÊÌâ
ʹÓÃÊäÈëÁ÷ת×Ö·û¶ÁͬÑù»á²úÉúÂÒÂ루º¹£©£¬×Ðϸ·ÖÎöÔÒò£¬Èç¹ûÎļþ±£´æÊÇANSI±àÂëµÄ£¨FileWriterдÈëĬÈÏÊǴ˱àÂ룩£¬ÄÇôÕâÀï±ØÐëÊÇiso8859-1£¬²¢ÇÒÐèҪת»»¡£
String r = null;
try {
BufferedReader br;
br = new BufferedReader(new InputStreamReader(new FileInputStream("/data/updatetime.dat"), "iso8859-1"));
String line = null;
StringBuffer result = new StringBuffer();
while((line = br.readLine()) != null) {
result.append(line);
}
br.close();
r = result.toString();
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
System.out.println(r);
//ÕâÀïͬÑù»áÓÐÂÒÂëÎÊÌâ
ÏÂÃæÊDz»»áÂÒÂëµÄµÄ·½Ê½
Èç¹ûÊý¾ÝÎļþΪANSI±àÂ루ĬÈÏ£©
BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream("/data/updatetime.dat"), "iso8859-1"));
String line = null;
StringBuffer result = new StringBuffer();
while((line = br.readLine()) != null) {
result.append(line + "<br />");
}
br.close();
String r = new String(result.toString().getBytes("iso8859-1"), "utf-8");
System.out.println(r);
Èç¹ûÊý¾ÝÎļþΪUTF-8±àÂë
Bu
Ïà¹ØÎĵµ£º
±¾ÎÄת×Ô£ºhttp://cyp-034.blog.163.com/blog/static/2823190520074691849380/
stream
´ú±íµÄÊÇÈκÎÓÐÄÜÁ¦²ú³öÊý¾ÝµÄÊý¾ÝÔ´£¬»òÊÇÈκÎÓÐÄÜÁ¦½ÓÊÕÊý¾ÝµÄ½ÓÊÕÔ´¡£ÔÚJavaµÄIOÖУ¬ËùÓеÄstream£¨°üÀ¨InputstreamºÍ
Out stream£©¶¼°üÀ¨Á½ÖÖÀàÐÍ£º
(1)×Ö½ÚÁ÷
±íʾÒÔ×Ö½ÚΪµ¥Î»´ÓstreamÖжÁÈ¡»òÍùstreamÖÐдÈë ......
1¡¢´´½¨ Statement ¶ÔÏó
½¨Á¢Á˵½Ìض¨Êý¾Ý¿âµÄÁ¬½ÓÖ®ºó£¬¾Í¿ÉÓøÃÁ¬½Ó·¢ËÍ SQL Óï¾ä¡£Statement ¶ÔÏóÓà Connection µÄ·½·¨ createStatement ´´½¨£¬ÈçÏÂÁдúÂë¶ÎÖÐËùʾ£º
Connection con = DriverManager.getConnection(url, "sunny", "");
Statement stmt = con.createStatement();
ΪÁËÖ´ÐÐ Statement ¶ÔÏ󣬱»· ......
1.ÉèÖÃCookie
Cookie cookie = new Cookie("key", "value");
cookie.setMaxAge(60);
ÉèÖÃ60ÃëÉú´æÆÚ£¬Èç¹ûÉèÖÃΪ¸ºÖµµÄ»°£¬ÔòΪä¯ÀÀÆ÷½ø³ÌCookie(ÄÚ´æÖб£´æ)£¬¹Ø±Õä¯ÀÀÆ÷¾ÍʧЧ¡£
cookie.setPath("/test/test2");
ÉèÖÃCookie·¾¶£¬²»ÉèÖõĻ°Îªµ±Ç°Â·¾¶(¶ÔÓÚServletÀ´ËµÎªrequest. ......
A:²»´øÊä³ö²ÎÊýµÄ
---------------²»´øÊä³ö²ÎÊýµÄ----------------------------------
create procedure getsum
@n int =0<--´Ë´¦Îª²ÎÊý-->
as
declare @sum int<--¶¨Òå±äÁ¿-->
declare @i int
set @sum=0
set @i=0
while @i<=@n begin
set @sum=@sum+@i
set @i=@i+1
end
print ......
¿µÊ¢µÄ authcode º¯Êý¿ÉÒÔ˵¶ÔÖйúµÄPHP½ç×÷³öÁËÖØ´ó¹±Ïס£°üÀ¨¿µÊ¢×Ô¼ºµÄ²úÆ·£¬ÒÔ¼°´ó²¿·ÖÖйúʹÓÃPHPµÄ¹«Ë¾¶¼ÓÃÕâ¸öº¯Êý½øÐмÓÃÜ£¬authcode ÊÇʹÓÃÒì»òÔËËã½øÐмÓÃܺͽâÃÜ¡£
ÔÀíÈçÏ£¬¼ÙÈ磺
¼ÓÃÜ
Ã÷ÎÄ£º1010 1001
Ãܳףº1110 0011
ÃÜÎÄ£º0100 1010
µÃ³öÃÜÎÄ0100 1010£¬½âÃÜÖ®ÐèºÍÃܳ×Òì»òϾͿÉÒÔÁË
½âÃÜ ......