2008年9月17日

               摘要: import java.io.*;

          public class Demo {
          public static void main(String[] args) {
          File dirFile;
          File tempFile;
          boolean bFile;
          String sFileName;

          bFile = false;

          try {
          dirFile = new File("E:\\test");
          bFile = dirFile.exists();

          if (bFile == true) {
          System.out.println("The folder exists.");
          } else {
          System.out
          .println("The folder do not exist,now trying to create a one...");
          bFi  閱讀全文
          posted @ 2008-09-18 10:11 anoic 閱讀(1529) | 評論 (1)編輯 收藏

          如此這般就可以取得項目發布的絕對路徑。x就為路徑

                  ActionContext ac = ActionContext.getContext();
                  ServletContext sc 
          = (ServletContext) ac.get(ServletActionContext.SERVLET_CONTEXT);
                  String x 
          = sc.getRealPath("/");
          posted @ 2008-09-17 17:02 anoic 閱讀(3500) | 評論 (1)編輯 收藏

          導航

          <2008年9月>
          31123456
          78910111213
          14151617181920
          21222324252627
          2829301234
          567891011

          統計

          常用鏈接

          留言簿(3)

          隨筆檔案

          文章檔案

          搜索

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 阿拉善右旗| 云龙县| 余姚市| 南岸区| 武冈市| 米脂县| 永和县| 得荣县| 镇江市| 田阳县| 腾冲县| 招远市| 南部县| 台湾省| 卫辉市| 义乌市| 淮北市| 营口市| 年辖:市辖区| 明光市| 静乐县| 天津市| 民勤县| 廉江市| 定襄县| 开远市| 肇州县| 沙雅县| 芜湖市| 贵港市| 河北省| 黄石市| 清水河县| 绥江县| 台中县| 上犹县| 潢川县| 双流县| 葵青区| 巴彦淖尔市| 长沙县|