搜尋此網誌

windows常用命令

[ 群組原則 ]
開始 → 執行 → gpedit.msc

[ 惡意軟體移除工具 ]
開始 → 執行 → mrt

[ 機碼 ]
開始 → 執行 → regedit

[ 系統設定公用程式 ]
開始 → 執行 → msconfig

[ 控制client端所有網路設備 ]
開始 → 執行 → cmd → ipconfig
開始 → 執行 → cmd → ipconfig/all

[ 顯示封包經過的路由器的IP位址 ]
開始 → 執行 → cmd → tracert (網址或IP)

2011年9月14日 星期三

讀取檔案,寫入檔案

//讀取
String fileFullPath = "C:\\Documents and Settings\\Irving\\桌面\\LOG_"+getClass().getName()+"_1.txt";
BufferedReader bf = new BufferedReader(new InputStreamReader( new FileInputStream(fileFullPath), "UTF-16LE"));

//寫入
String fileFullPath = "C:\\Documents and Settings\\Irving\\桌面\\LOG_"+getClass().getName()+"_1.txt";

BufferedWriter bw = new BufferedWriter(new OutputStreamWriter ( new FileOutputStream(fileFullPath), "UTF-8"));
            for(int w=0; w<listSQL.size(); w++) {//listSQL要寫入的東西
            bw.write(String.valueOf("第"+ (w+1) + "筆 \n"));
            bw.write(listSQL.get(w));
            bw.write("\r\n");
             bw.flush();
            }