当前位置: 技术问答>java相关
只给一个目录路径,怎样再在其下建立一个新的目录(给定目录名),然后再在其下建立一个新的文件(给定文件名)?
来源: 互联网 发布时间:2015-04-08
本文导语: 谢谢大家!向大家学习! | 试试看: String m_strPath = "c:\data"; File m_fConfRecordPath = null; m_fConfRecordPath=new File(m_strPath+"\project"); if(!m_fConfRecordPath.exists()) { m_fConfRecordPath.mkdir(); } File m_fFileRecor...
谢谢大家!向大家学习!
|
试试看:
String m_strPath = "c:\data";
File m_fConfRecordPath = null;
m_fConfRecordPath=new File(m_strPath+"\project");
if(!m_fConfRecordPath.exists())
{
m_fConfRecordPath.mkdir();
}
File m_fFileRecord=new File(m_fConfRecordPath,"YourData.dat");
String m_strPath = "c:\data";
File m_fConfRecordPath = null;
m_fConfRecordPath=new File(m_strPath+"\project");
if(!m_fConfRecordPath.exists())
{
m_fConfRecordPath.mkdir();
}
File m_fFileRecord=new File(m_fConfRecordPath,"YourData.dat");
|
File f=new File("目录路径");
f.mkdirs("给定目录名2文件名");
f.mkdirs("给定目录名2文件名");