本文转载自:http://blog.163.com/michaelgaoit%40126/blog/static/11389538620103711613620/web 上运行1:this.getClass().getClassLoader().getResource("/").getPath();...
分类:
编程语言 时间:
2015-02-02 17:44:47
阅读次数:
146
第一种:File f = new File(this.getClass().getResource("/").getPath());System.out.println(f);结果:C:\Documents%20and%20Settings\Administrator\workspace\proje...
分类:
编程语言 时间:
2015-01-30 10:40:09
阅读次数:
628
CString getPath(){ CTime time = CTime::GetCurrentTime(); CString t = time.Format(_T("%Y%m%d%H%M%S")); CString path("c://cjt//"); path.Append(_T("devic...
分类:
编程语言 时间:
2015-01-29 22:29:03
阅读次数:
280
private void display() { String path=this.getClass().getResource("").getPath(); System.out.println(path); path=this.getClass(...
分类:
其他好文 时间:
2015-01-26 22:23:34
阅读次数:
208
1 function getPath(obj,fileQuery,transImg) 2 { 3 if(window.navigator.userAgent.indexOf("MSIE")>=1){ 4 obj.selec...
分类:
其他好文 时间:
2015-01-10 11:12:54
阅读次数:
149
区分文件的操作与文件内容的操作(I/O)
文件的操作是对File类
File f 构造函数需要文件名(和路径)
获得当前路径
System.getProperty("user.dir") 默认指定为当前目录 或File 中的getPath
文件内容操作
分为字节流、字符流。read() 一个是byte 一个是char
字节流抽象类:InputStream、Outp...
分类:
编程语言 时间:
2015-01-02 09:50:34
阅读次数:
213
java 获取web根目录的方法我目前用到的有两种:
1,获取类方法所在的目录截取根目录
//在类FreemarkerUtil中获取其class目录
String path = FreemarkerUtil.class.getClassLoader().getResource("").getPath();//执行后path为/D:/Workspace/tourservice/WebConte...
分类:
编程语言 时间:
2014-12-29 12:06:38
阅读次数:
133
下面的设计稍微繁琐一些,有必要把思路说清楚。
下一步的主要实现当我们点击Go按钮后,得到骰子随机数,就是行走的步数,根据步数获取行走的路径,然后角色根据路径移动位置。大体流程如图所示:
这其中getPath()获取路径的方法有必要说清楚,还是看流程图吧
思路大体是这样的,代码实现上可能存在一些差别,但是不影响我们的整体设计思想。
我们开始...
分类:
其他好文 时间:
2014-12-19 07:03:44
阅读次数:
334
/// /// 数据备份 /// /// public bool DataBackup(string getpath) { try { SqlConnection con = new SqlConnection();//利用代码实现连接数据库 con.ConnectionString = Co...
分类:
数据库 时间:
2014-12-12 11:29:00
阅读次数:
322
/** 得到系统可用内存 **/
@SuppressLint("NewApi")
private String getMemFree(){
StatFs fs = new StatFs(Environment.getDataDirectory().getPath());
return Formatter.formatFileSize(this, (fs.getAvailableByte...
分类:
移动开发 时间:
2014-12-09 17:54:23
阅读次数:
204