Java³ÌÐòÐÞ¸ÄÎļþÃû
package script;
import java.io.File;
import java.io.IOException;
public class Realname {
public static void main(String[] args) throws IOException
{
File oldFile = new File("d:/PMS");
if(!oldFile.exists())
{
oldFile.createNewFile();
}
System.out.println("ÐÞ¸ÄǰÎļþÃû³ÆÊÇ£º"+oldFile.getName());
String rootPath = oldFile.getParent();
System.out.println("¸ù·¾¶ÊÇ£º"+rootPath);
File newFile = new File(rootPath + File.separator + "PMSTmp");
System.out.println("Ð޸ĺóÎļþÃû³ÆÊÇ£º"+newFile.getName());
if (oldFile.renameTo(newFile))
{
System.out.println("Ð޸ijɹ¦!");
}
else
{
System.out.println("ÐÞ¸Äʧ°Ü");
}
}
}
Ïà¹ØÎĵµ£º
1.
ÓÐÕâÑùÒ»ÖÖ˵·¨£¬Èç½ñÕù·æÓÚITÕ½³¡µÄÁ½´óÊÆÁ¦£¬MSÒ»×寫֨ÓڵײãʵÏÖ£¬JavaÒ»×寫֨ÓÚϵͳ¼Ü¹¹¡£Ëµ·¨¸ù¾ÝÎÞ´Ó¿¼Ö¤£¬µ«´ÓÁ½´óÊÆÁ¦¸÷×ÔµÄÉçÇøÁ¦Á¿ºÍͼÊéÊг¡ÒÑÓмÑ×÷²»ÄÑ¿´³ö£¬´Ë˵·¨²»Ð飬µ«ÕÆÎÕJavaµÄµ×²ãʵÏÖ¶ÔJava³ÌÐòÔ±À´ËµÊÇÖÁ¹ØÖØÒªµÄ£¬±¾ÎĽéÉÜÁËJavaÖеÄÊý¾ÝÔÚÄÚ´æÖеĴ洢¡£
¡¡¡¡
¡¡¡¡2 ÄÚ´æÖ ......
Ò»¡¢JavaÔ´Îļþ
1¡¢Ò»¸öJavaÓ¦Óðüº¬Ò»¸ö»ò¶à¸öJavaÔ´Îļþ£¬Ã¿¸öJavaÔ´ÎļþÖ»Äܰüº¬ÏÂÁÐÄÚÈÝ(¿Õ¸ñºÍ×¢ÊͳýÍâ)
l Áã¸ö»òÒ»¸ö°üÉùÃ÷Óï¾ä
l Áã¸ö»ò¶à¸ö°üÒýÈëÓï¾ä
l Áã¸ö»ò¶à¸öÀàÉùÃ÷Óï¾ä
l Áã¸ö»ò¶à¸ö½Ó¿ÚÉùÃ÷
2¡¢Ã¿¸öJavaÔ´Îļþ¿É°üº¬¶à¸öÀà»ò½Ó¿ÚµÄ¶¨Ò壬µ«ÊÇÖÁ¶àÖ»ÓÐÒ»¸öÀà»òÕß½Ó¿ÚÊÇpublicµÄ£¬¶øÇÒJavaÔ´Îļþ±ØÐëÒÔ ......
1¡¢Óï·¨£ºJava³ÌÐòÔ±±ØÐë±È½ÏÊìϤÓï·¨£¬ÔÚд´úÂëµÄʱºòIDEµÄ±à¼Æ÷¶ÔijһÐб¨´íÓ¦¸ÃÄܹ»¸ù¾Ý±¨´íÐÅÏ¢ ÖªµÀÊÇʲôÑùµÄÓï·¨´íÎó²¢ÇÒÖªµÀÈκÎÐÞÕý¡£
2¡¢ÃüÁ±ØÐëÊìϤJDK´øµÄһЩ³£ÓÃÃüÁî¼°Æä³£ÓÃÑ¡ÏÃüÁîÖÁÉÙÐèÒªÊìϤ£ºappletviewer¡¢ HtmlConverter¡¢jar¡¢ java¡¢ javac¡¢javadoc¡¢javap¡¢javaw¡¢native2ascii¡¢serialv ......
//JavaÎļþÏÂÔØµÄ¼¸ÖÖ·½Ê½
public HttpServletResponse download(String path, HttpServletResponse response) {
try {
// pathÊ ......
String str = "ÖÐ";
String str1 = new String(str.getBytes("gbk"), "ISO8859-1");
String str2 = new String(str1.getBytes("ISO8859-1"), "gbk");
System.out.println(str2); //Êä³ö"ÖÐ" ......