删除功能:public boolean delete() * * 注意: * A:如果你创建文件或者文件夹忘了写盘符路径,那么,默认在项目路径下。 * B:Java中的删除不走回收站。 * C:要删除一个文件夹,请注意该文件夹内不能包含文件或者文件夹 */public class FileDemo Read More
posted @ 2018-01-08 21:26 秦先生的客栈 Views(212) Comments(0) Diggs(0) Edit
创建功能: *public boolean createNewFile():创建文件 如果存在这样的文件,就不创建了 *public boolean mkdir():创建文件夹 如果存在这样的文件夹,就不创建了 *public boolean mkdirs():创建文件夹,如果父文件夹不存在,会帮你 Read More
posted @ 2018-01-08 21:23 秦先生的客栈 Views(314) Comments(0) Diggs(0) Edit
构造方法: * File(String pathname):根据一个路径得到File对象 * File(String parent, String child):根据一个目录和一个子文件/目录得到File对象 * File(File parent, String child):根据一个父File对象 Read More
posted @ 2018-01-08 21:19 秦先生的客栈 Views(112) Comments(0) Diggs(0) Edit
public String getServiceIp(){ InetAddress address; String myIp; try { address = InetAddress.getLocalhost(); myIp = address.getHostAddress(); } catch ( Read More
posted @ 2018-01-08 21:13 秦先生的客栈 Views(1505) Comments(0) Diggs(0) Edit