JavaÎļþ²Ù×÷´óÈ«£¨Ê®£©
73.FTPÏÂÔØ
/*
import sun.net.ftp.FtpClient;
import java.io.*;
import sun.net.*;
*/
//Èç¹ûÎļþÔÚij¸öĿ¼Ï£¬Ôò¼ÓÈëfc.cd("foodir");
//±ÈÈçÒªÏÂÔØftp://ftp.xx.com/index.htmlÔò£º
try
{
FtpClient fc=new FtpClient("ftp.xx.com");
fc.login("username","888888");
int ch;
File fi = new File("c:\\index.html");
RandomAccessFile getFile = new RandomAccessFile(fi,"rw");
getFile.seek(0);
TelnetInputStream fget=fc.get("index.html");
DataInputStream puts = new DataInputStream(fget);
while ((ch = puts.read()) >= 0) {
getFile.write(ch);
}
fget.close();
getFile.close();
fc.closeServer();
}
catch (IOException ex)
{
ex.printStackTrace();
}
74.дͼÏñµ½¼ôÇаå setClipboardImage
/*
import java.awt.*;
import java.awt.datatransfer.*;
import java.io.*;
*/
private final Image image;
Transferable trans = new Transferable() {
public DataFlavor[] getTransferDataFlavors() {
return new DataFlavor[] { DataFlavor.imageFlavor };
}
public boolean isDataFlavorSupported(DataFlavor flavor) {
return DataFlavor.imageFlavor.equals(flavor);
}
public Object getTransferData(DataFlavor flavor)
throws UnsupportedFlavorException, IOException {
if (isDataFlavorSupported(flavor))
return image;
throw new UnsupportedFlavorException(flavor);
}
};
Toolkit.getDefaultToolkit().getSystemClipboard().setContents(trans,
null);
75.´Ó¼ôÌù°å¸´ÖÆͼÏñµ½´°Ìå
76.ɾ³ýÎļþ¼ÐϵÄËùÓÐÎļþÇÒ²»É¾³ýÎļþ¼ÐϵÄÎļþ¼Ð
//import java.io.*;
//import java.util.*;
LinkedList<String> folderLi
Ïà¹ØÎĵµ£º
/ÓÉÓÚJAVAÓïÑÔµÄÊý¾ÝÀàÐͶ¼ÊÇÓзûºÅÀàÐÍ£¬¶øC# C++Ò»°ãÊý¾ÝÀàÐͶ¼ÊÇ·ÖÓзûºÅºÍÎÞ·ûºÅ,
//Òò´ËÔÚͨÐŹý³ÌÖд«µÝµÄByte[]ÎÞ·¨Ö±
½Óת»»³ÉC#ÐèÒªµÄÀàÐÍ£¬
//ÒÔÇ°µ¹ÊÇûעÒâÕâЩϸ½Ú£¬ÒòΪһ°ãÓÃÒ»ÖÖÓïÑÔ±à³Ì£¬
//´ó¶¼ÓÐÄÚÖõÄת»»·½·¨¡£¿çÓïÑÔ»·¾³µÄת»»¾ÍµÄ×Ô¼º¶¯
ÊÖÏë°ì·¨ÁË¡£
1¡¢javaµÄByte[]ת»»³Éc#µÄInt32
privat ......
Ctrl+1 ¿ìËÙÐÞ¸´(×î¾µäµÄ¿ì½Ý¼ü,¾Í²»Óöà˵ÁË)
Ctrl+D: ɾ³ýµ±Ç°ÐÐ
Ctrl+Alt+↓ ¸´ÖƵ±Ç°Ðе½ÏÂÒ»ÐÐ(¸´ÖÆÔö¼Ó)
Ctrl+Alt+↑ ¸´ÖƵ±Ç°Ðе½ÉÏÒ»ÐÐ(¸´ÖÆÔö¼Ó)
Alt+↓ µ±Ç°ÐкÍÏÂÃæÒ»Ðн»»¥Î»ÖÃ(ÌرðʵÓÃ,¿ÉÒÔÊ¡È¥ÏȼôÇÐ,ÔÙÕ³ÌùÁË)
Alt+↑ µ±Ç°ÐкÍÉÏÃæÒ»Ðн»»¥Î»ÖÃ(ͬÉÏ)
Alt+← Ç°Ò»¸ö±à¼µ ......
39.дÈëXMLÊý¾Ý¿â
//import java.io.*;
//import javax.xml.parsers.*;
//import org.xml.sax.*;
//import org.w3c.dom.*;
//import javax.xml.transform.*;
//import javax.xml.transform.dom.*;
//import javax.xml.transform.stream.*;
private Document ......
AddressModel md = (AddressModel) getModel(AddressModel.class, request);
ByteArrayOutputStream byteOut = new ByteArrayOutputStream();
ObjectOutputStream out = new ObjectOutputStream(byteOut);
out.writeObject(md);
ByteArra ......