zoukankan      html  css  js  c++  java
  • 文件创建

    //文件创建
    public boolean creatFile(String fatherFile,String childFile){
     File dirObject = new File(fatherFile);
            File fileObject = new File(fatherFile,childFile);
            try{
                dirObject.mkdir();
            }catch(SecurityException e){
                e.printStackTrace();
            }
            try{
                fileObject.createNewFile();
            }catch(IOException e)
            {
                e.printStackTrace();
            }
            if(fileObject.exists())
             return true;
            return false;
     }
    //*****************************************************************************
    代码
    //文件创建
    public boolean creatFile(String fatherFile,String childFile){
    File dirObject
    = new File(fatherFile);
    File fileObject
    = new File(fatherFile,childFile);
    try{
    dirObject.mkdir();
    }
    catch(SecurityException e){
    e.printStackTrace();
    }
    try{
    fileObject.createNewFile();
    }
    catch(IOException e)
    {
    e.printStackTrace();
    }
    if(fileObject.exists())
    return true;
    return false;
    }
    //*****************************************************************************
  • 相关阅读:
    Win32的开发过程
    Win32的开发过程
    内存模式
    在DOS下生成一个可执行文件一般步骤
    内存模式
    内存模式
    静态链接
    在DOS下生成一个可执行文件一般步骤
    备忘录模式(存档模式)
    建造者模式
  • 原文地址:https://www.cnblogs.com/frostbelt/p/1766769.html
Copyright © 2011-2022 走看看