学习记录——【转】java中打开explorer
很我找了好久 终于找到了.....
以下是转文:
//--------------------------------------------------------------------------------------------------
方法很简单,调用explorer.exe就可以,
Runtime.getRuntime().exec(
"rundll32 SHELL32.DLL,ShellExec_RunDLL " +
"Explorer.exe /select," + targetDirectFileName);
//以下内容不需要....
[Windows Explorer Switches]
Windows Explorer switches are useful in creating rooted folders:
Explorer [/e][,/root,<object>][[,/select],<sub object>]
/e
Use Explorer view (scope and results pane view). The default is
Open view (results in pane view only).
/root<object>
Specify the object in the "normal" name space that is
used as the root (top level) of this Explorer/Folder (i.e., local
path or UNC name). The default is the Desktop).
/Select
The parent folder opens and the specified object is selected.
<sub object> Specify the folder unless /select is used. The
default is the root.
本文来自CSDN博客:http://blog.csdn.net/denlee/archive/2007/04/23/1575961.aspx
//--------------------------------------------------------------------------------------------------
以上是原文 下面是个人尝试
举个例子:Runtime.getRuntime().exec(
"rundll32 SHELL32.DLL,ShellExec_RunDLL " +
"Explorer.exe /select," + “c:/”);
这样就打开C盘了 ,经试验 那几个dll文件也可以不添加 直接写:
Runtime.getRuntime().exec( "Explorer.exe /select," + "c:/");也行
相关文档:
明天有一个新的就业班开课了,有的同学决定转班,自己心里也挺矛盾的,犹豫不决!
去可以让自己对基础更加熟练,毕竟所有的知识都是新东西,如果有更多的时间练习,效果一
定更好!不去是觉得原理都懂得了,只要坚持上完剩下的课程,可以再去慢慢练习代码,没有
必要浪费时间?好矛盾,明天找张老师咨询下....
今 ......
一、
问:org.postgresql.util.PSQLException: FATAL: no pg_hba.conf entry for host "192.168.254.103", user "postgres",database "postgres", SSL off
答:PostgreSQ数据库为了安全,它不会监听除本地以外的所有连接请求,当用户通过JDBC访问是,就会报一些以上的异常。要解决这个问题 ......
为了实现自定义的log类,能够输出具体的代码行行号,通过使用StackTraceElement对象实现了。
这里指出需要注意的几个问题:
1. 程序中返回的代码行行号,是新建StackTrackElement对象的那一行。
2. 可以通过传参的方法实现输出特定行行号。具体实现见代码。
1/**
2 *
3 */
4package leo.demo ......
关于绝对路径和相对路径:
绝对路径就是你的主页上的文件或目录在硬盘上真正的路径,(URL和物理路径)例如:C:xyz est.txt 代表了test.txt文件的绝对路径。http://www.sun.com/index.htm也代表了一个URL绝对路径。相对路径:相对与某个基准目录的路径。包含Web的相对路径(HTML中的相对目录),例如:在Servlet中,"/"代表W ......
1、字符串长度
String s1 = "我是中国人";
String s2 = "imchinese";
String s3 = "im中国人";
System.out.println(s1+":"+new String(s1).length());
System.out.println(s2+":"+new String(s2).length());
System.out.println(s3+ ......