如何用JAVA方法在一个指定的文件夹下按照要求建立文件夹 我想写一个方法,在d:/att目录下用JAVA方法按照不同的年月建立目录.例如现在是2006年10月,程序判断后就在d:/att下建立200610这个目录,如果是2006年12月就建立200612文件夹.求助大家帮忙. 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 public static SimpleDateFormat format1 = new SimpleDateFormat("yyyyMM");static java.util.Date sysdate = new java.util.Date();File xmld= new File("d:\\att\\"+format1.format(sysdate));if(!xmld.exists()){ xmld.mkdir();//建立目录} 1。新建目录<%@ page contentType="text/html;charset=gb2312"%><%String filePath="c:/aaa/";filePath=filePath.toString();//中文转换java.io.File myFilePath=new java.io.File(filePath);if(!myFilePath.exists())myFilePath.mkdir();%> 2。新建文件<%@ page contentType="text/html;charset=gb2312"%><%@ page import="java.io.*" %><%String filePath="c:/哈哈.txt";filePath=filePath.toString();File myFilePath=new File(filePath);if(!myFilePath.exists())myFilePath.createNewFile();FileWriter resultFile=new FileWriter(myFilePath);PrintWriter myFile=new PrintWriter(resultFile);String strContent = "中文测试".toString();myFile.println(strContent);resultFile.close();%> 获取单选框的value值! 急!!!!jsp显示word java web service 求助 struts多模块的配置问题... jsp页面的参数传递和接收问题 请帮我看看哪里写错了?? 关于报表!十万火急! 关于关闭数据库连接!在线等 javaweb的el表达式写法 急!急!急!tomcat下jsp程序的问题!!高手请进!!! Tomcat 问题: Cannot serialize session attribute XXX for 一个非常简单的问题,能有高手解决一下吗?
static java.util.Date sysdate = new java.util.Date();
File xmld= new File("d:\\att\\"+format1.format(sysdate));
if(!xmld.exists()){
xmld.mkdir();//建立目录
}
<%
String filePath="c:/aaa/";
filePath=filePath.toString();//中文转换
java.io.File myFilePath=new java.io.File(filePath);
if(!myFilePath.exists())
myFilePath.mkdir();
%> 2。新建文件<%@ page contentType="text/html;charset=gb2312"%>
<%@ page import="java.io.*" %>
<%
String filePath="c:/哈哈.txt";
filePath=filePath.toString();
File myFilePath=new File(filePath);
if(!myFilePath.exists())
myFilePath.createNewFile();
FileWriter resultFile=new FileWriter(myFilePath);
PrintWriter myFile=new PrintWriter(resultFile);
String strContent = "中文测试".toString();
myFile.println(strContent);
resultFile.close();
%>