FTP連接的辦法以及配置方式是怎樣的,很多新手對此不是很清楚,為了幫助大家解決這個難題,下面小編將為大家詳細講解,有這方面需求的人可以來學習下,希望你能有所收獲。
成都創(chuàng)新互聯(lián)公司主要從事網(wǎng)站制作、網(wǎng)站設(shè)計、網(wǎng)頁設(shè)計、企業(yè)做網(wǎng)站、公司建網(wǎng)站等業(yè)務。立足成都服務隆化,十年網(wǎng)站建設(shè)經(jīng)驗,價格優(yōu)惠、服務專業(yè),歡迎來電咨詢建站服務:028-86922220
使用FTP上傳工具進行遠程連接
FTP用于在FTP服務器和FTP客戶端之間上傳和下載文件,它最優(yōu)秀的功能就是可以批量管理,可以將文件從一個主機傳輸?shù)搅硪粋€主機。
地址: FTP上傳工具
使用FTP上傳工具最優(yōu)秀的功能就是可以批量管理、批量上傳,適用于Windows系統(tǒng),Linux系統(tǒng)和云服務器等,能極大的提高站長及服務器運維人員工作效率,同時FTP上傳工具還是vnc客戶端,真正實現(xiàn)了一站式管理,非常方便。
java下配置連接FTP:
public void putTxtToFTP() { System.out.println("開始執(zhí)行定時器任務:維系一鍵訂單量!"); Calendar calendar = Calendar.getInstance(); calendar.add(Calendar.DATE, -1); //得到前一天 Date date = calendar.getTime(); SimpleDateFormat df = new SimpleDateFormat("yyyyMMdd"); String yesterday = df.format(date); StringBuffer yjtjOrderTxt = new StringBuffer(); yjtjOrderTxt.append("yjtywx_").append(yesterday).append(".txt"); List<WxActiveData> yjtjOrderList = activeDataService.wxGetYjtjOrder(); //FtpUtil ftpUtil = new FtpUtil("hexin","hx105155","134.64.105.155", "/yjtydd"); //測試庫FTP FtpUtil ftpUtil = new FtpUtil("ahftp","ahdx@#$_123dic","192.168.0.28", "/yjtydd"); PrintWriter printWriter = null; File highFeeFile = new File(Contants.FILE_PATH_BAK + yjtjOrderTxt);//Contants.FILE_PATH_BAK = "/opt/wss/domains/tmp/" // File highFeeFile = new File("D:/" + highFeeTxt); // File gjmyFile = new File("D:/" + gjmyTxt); //File highFeeFile = new File("D:/" + yjtjOrderTxt); try { printWriter = new PrintWriter(new FileWriter(highFeeFile, true)); for (int i = 0; i < yjtjOrderList.size(); i++){ printWriter.println(yjtjOrderList.get(i).toString().trim()); } } catch (IOException e) { System.out.println("主動服務 高額數(shù)據(jù)報表任務異常!"); }finally{ printWriter.close(); } if(highFeeFile.exists()){ System.out.println("主動服務定時器任務 高額數(shù)據(jù) 上傳成功"+yjtjOrderTxt.toString()); ftpUtil.uploadFile(highFeeFile, yjtjOrderTxt.toString()); }else{ System.out.println("主動服務定時器任務 高額數(shù)據(jù) 上傳失敗"+yjtjOrderTxt.toString()); } System.out.println("服務器批量查排名-查詢結(jié)果"); } public ActiveDataService getActiveDataService() { return activeDataService; } public void setActiveDataService(ActiveDataService activeDataService) { this.activeDataService = activeDataService; }
看完上述內(nèi)容是否對您有幫助呢?如果還想對相關(guān)知識有進一步的了解或閱讀更多相關(guān)文章,請關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道,感謝您對創(chuàng)新互聯(lián)的支持。
網(wǎng)站名稱:FTP連接的辦法以及配置方式是怎樣的
文章分享:http://chinadenli.net/article44/jeiche.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供響應式網(wǎng)站、網(wǎng)站導航、手機網(wǎng)站建設(shè)、企業(yè)建站、小程序開發(fā)、網(wǎng)站設(shè)計
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)