Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

Java ÖÐÁ½ÖÖftp²Ù×÷·½Ê½

×î½ü¿´µ½¼¸Æª¹ØÓÚjavaÖвÙ×÷ftpµÄÎÄÕ£¬ËùÒÔÏëдһ¸ö×ܽáÌù£¬±ê¼Çһϣ¬·½±ãÒÔºóÓ¦Óá£
Ê×ÏÈ£¬ÎÒÃÇ¿ÉÒÔÓ¦ÓÃjavaÖеÄftp¿â£¬javaÖÐÌṩÁËÒ»¸öftpclientµÄÀ࣬ÌṩÁ˺ܶà²Ù×÷ftpµÄ·½·¨¡£
ÏÈÉÏ´úÂ룬һ¿´±ãÖª£¬ºÜ¼òµ¥£¬Ó¦ÓÃʱֻҪ´«µÝÏàÓ¦µÄserver£¬user£¬passwordµÈ¾ÍÐÐÁË¡£
import java.io.IOException;
import sun.net.*;
import sun.net.ftp.*;
public class FTP {

public static void main(String[] args) {

String ftpserver="server url";
String user="user";
String pwd="pwd";
String path="path";

try {

FtpClient ftpClient=new FtpClient();
ftpClient.openServer(ftpserver);

echo(ftpClient.getResponseString());

ftpClient.login(user, pwd);
echo(ftpClient.getResponseString());

if (path.length() != 0) {
ftpClient.cd(path);
echo(ftpClient.getResponseString());
}

TelnetInputStream tis = ftpClient.list();
echo(ftpClient.getResponseString());
int c;
while ((c = tis.read())!= -1) {
System.out.print((char)c);
}
echo(ftpClient.getResponseString());

tis.close();
echo(ftpClient.getResponseString());

ftpClient.closeServer();
echo(ftpClient.getResponseString());
}
catch(IOException ex){
ex.printStackTrace();
}
}

static void echo(String response){
System.out.println("Response-----> " + response);
}


ÔÚÆäÄÚ²¿¶¼ÊÇ·¢ËÍsocketÇëÇóµÄ£¬Ö»ÊÇ°ïÎÒÃÇ·â×°ºÃÁË¡£ÎÒÃÇÖ»ÒªÓÃÏàÓ¦µÄ·½·¨¾ÍÐÐÁË¡£
ÔÚÿ¸ö·½Ãæµ÷ÓúóÃæÎÒ¶¼´òÓ¡ÁË´Ó·þÎñÆ÷·µ»ØµÄÄÚÈÝ£¬ÕâÑù¿ÉÒÔ·½±ãÎÒÃÇftpЭÒéµÄÀí½â¡£
¶ÁÕß¿ÉÒÔ¿½±´µ½±¾µØÔËÐÐһϣ¬¿´¿´ftpµ½µ×ÊÇÈçºÎÔËÐеġ£
ΪÁ˸üÇå³þµÄÀí½âftpЭÒ飬ÏÂÀ´Ê¹ÓÃԭʼµÄsocketÀ´²Ù×÷ftp¡£
ftp·þÎñÆ÷Ò»°ãÊÇÔÚ21¶Ë¿Ú¼àÌýµÄÒ»¸ö·


Ïà¹ØÎĵµ£º

java·ºÐÍÏê½â

·ºÐÍ£¨Generic type »òÕßgenerics£©ÊÇ¶Ô Java ÓïÑÔµÄÀàÐÍϵͳµÄÒ»ÖÖÀ©Õ¹£¬ÒÔÖ§³Ö´´½¨¿ÉÒÔ°´ÀàÐͽøÐвÎÊý»¯µÄÀà¡£¿ÉÒÔ°ÑÀàÐͲÎÊý¿´×÷ÊÇʹÓòÎÊý»¯ÀàÐÍʱָ¶¨µÄÀàÐ͵ÄÒ»¸öռλ·û£¬¾ÍÏñ·½·¨µÄÐÎʽ²ÎÊýÊÇÔËÐÐʱ´«µÝµÄÖµµÄռλ·ûÒ»Ñù¡£
¿ÉÒÔÔÚ¼¯ºÏ¿ò¼Ü£¨Collection framework£©Öп´µ½·ºÐ͵Ķ¯»ú¡£ÀýÈ磬MapÀàÔÊÐíÄúÏòÒ»¸öMapÌí ......

JAVA¼¯ºÏÀà


java.util°üÖоͰüº¬ÁËһϵÁÐÖØÒªµÄ¼¯ºÏÀ࣬¶ø¶ÔÓÚ¼¯ºÏÀ࣬Ö÷ÒªÐèÒªÕÆÎյľÍÊÇËüµÄÄÚ²¿½á¹¹£¬ÒÔ¼°±éÀú¼¯ºÏµÄµü´úģʽ¡£
½Ó¿Ú£ºCollection
ËùÓм¯ºÏÀàµÄ¸ùÀàÐÍ£¬Ö÷ÒªµÄÒ»¸ö½Ó¿Ú·½·¨£ºboolean add(Ojbect c)Ëä·µ»ØµÄÊÇboolean£¬µ«²»ÊDZíʾÌí¼Ó³É¹¦Óë·ñ£¬ÒòΪCollection¹æ¶¨£ºÒ»¸ö¼¯ºÏ¾Ü¾øÌí¼ÓÕâ¸öÔªËØ£¬ÎÞÂÛʲôԭÒò£¬¶¼± ......

JavaÄÚ´æ¹ÜÀí(¶þ¡¢JavaÀ¬»ø»ØÊÕ)

¶þ¡¢JavaÀ¬»ø»ØÊÕ
1. JVMÔËÐл·¾³ÖÐÀ¬»ø¶ÔÏóµÄ¶¨Òå
     Ò»¸ö¶ÔÏó´´½¨ºó±»·ÅÖÃÔÚJVMµÄ¶ÑÄÚ´æÖУ¬µ±ÓÀÔ¶²»ÔÙÒýÓÃÕâ¸ö¶ÔÏóʱ£¬Ëü½«±»JVMÔÚ¶ÑÄÚ´æÖлØÊÕ¡£»ò  µ±¶ÔÏóÔÚJVMÔËÐпռäÖÐÎÞ·¨Í¨¹ý¸ù¼¯ºÏ(root set)µ½´ïʱ£¬Õâ¸ö¶ÔÏó¾Í±»³ÆΪÀ¬»ø¶ÔÏó¡£
2. ¶ÑÄÚ´æ
* ÔÚJVMÆô¶¯Ê±±»´´½¨£»¶ÑÄÚ´æÖÐËù´æ´¢µ ......

Çø±ðjavaµÄ C++ÄÚ´æ·ÖÅä ֪ʶ,È«¾Ö£¬¾Ö²¿£¬¾²Ì¬±äÁ¿


Ô¤±¸ÖªÊ¶—³ÌÐòµÄÄÚ´æ·ÖÅä 
Ò»¸öÓÉC/C++±àÒëµÄ³ÌÐòÕ¼ÓõÄÄÚ´æ·ÖΪÒÔϼ¸¸ö²¿·Ö 
1¡¢Õ»Çø£¨stack£©— ÓɱàÒëÆ÷×Ô¶¯·ÖÅäÊÍ·Å £¬´æ·Åº¯ÊýµÄ²ÎÊýÖµ£¬¾Ö²¿±äÁ¿µÄÖµµÈ¡£Æä²Ù×÷·½Ê½ÀàËÆÓÚÊý¾Ý½á¹¹ÖеÄÕ»¡£ 
2¡¢¶ÑÇø£¨heap£© — Ò»°ãÓɳÌÐòÔ±·ÖÅäÊÍ·Å£¬ Èô³ÌÐòÔ±²»ÊÍ·Å£¬³ÌÐò½áÊøʱ¿ÉÄÜÓÉOS»ØÊÕ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ