File p = new File(pathname);
if (!(p.exists() && p.isDirectory()))
p.mkdirs();
PrintWriter pw = new PrintWriter(new FileOutputStream(pathname + Filename));
pw.println(getData());
pw.close();String getData(){
//从数据库读出文本,用循环生成一个String返回
}
if (!(p.exists() && p.isDirectory()))
p.mkdirs();
PrintWriter pw = new PrintWriter(new FileOutputStream(pathname + Filename));
pw.println(getData());
pw.close();String getData(){
//从数据库读出文本,用循环生成一个String返回
}
解决方案 »
- flash插件不随鼠标滚动
- 请教神人,把我从数据库中读出来的数据写入独立log4j日志文件,要怎么弄啊
- 关于logic:iterate循环的问题
- 请问支持ajax的网站需要服务器安装什么插件呢?
- 请求高手帮助:严重: Exception sending context initialized
- 求助,WebLogic的问题。
- 微软到我的网站想干什么?
- Exchange下怎么用Java Mail发信?
- jsp或servlet作mis太差,交互性不好,和c/s差多了,我感觉这种方案比较好:
- highcharts
- 如何取一个disabled后的select 的value值,着急...
- ireport和jasperreport的报表打印问题,显示不出来,也没报错,很困惑。
public class Runtime1 {
public static void main(String[] args) {
String path = "e:\\Project1.exe";
try {
Runtime.getRuntime().exec("cmd /c start " + path);
} catch (IOException e) {
e.printStackTrace();
}
}
}
response.setContentType("application/vnd.ms-excel;charset=GB2312");
//excel打开response.setContentType("application/msword;charset=GB2312");
//word打开response.setContentType("application/ms-excel;charset=GB2312");
response.setHeader("Content-disposition","attachment; filename=data.xls");
//允许保存