自己使用java做的小工具
当你在你自己的电脑上装的东西比较多的时候,而且执行程序有很乱,让你也很不好找,下面这个是我用java写的一段小程序,直接在你的运行窗口输入 java open ??就可以打开你自己的想要的环境或者工具了
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
public class open {
public static void main(String [] s){
Map m=new HashMap();//使用map集合
m.put("cb","C:/Program Files/Kingsoft/PowerWord_Oxford/XDict.exe");//通过键值来保存你可执行程序的物理路径
m.put("360","C:/Program Files/360/360safe/360Safe.exe");
m.put("flash","C:/Program Files/Macromedia/Flash 8/Flash.exe");
m.put("d8","C:/Program Files/Macromedia/Dreamweaver 8/Dreamweaver.exe");
m.put("flash","C:/Program Files/ipmsg/ipmsg.exe");
m.put("netBeans","C:/Program Files/NetBeans 6.5.1/bin/netbeans.exe");
m.put("php","C:/Program Files/Zend/Zend Studio for Eclipse - 6.1.2/ZendStudio.exe");
String ss=s[0];//程序启动时给程序参数赋值
try {
Runtime.getRuntime().exec((String)m.get(ss));//调用程序
} catch (IOException e) {
System.out.println("程序运行错误");
}
}
}
不过这个用java写还是比较不好用的,一会我看看在用C#写一个这样的小程序
相关文档:
Introduction to XML and XML With Java
If you are looking for sample programs to parse a XML file using DOM/SAX parser or looking for a program to generate a XML file please proceed directly to programs.
This small tutorial introduces you to the basic concepts of XML and using Xer ......
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
/**
*
* @description 本程序实现了读取注册表分支:HKEY_CURRENT_USER\Software\ODBC\ODBC.INI\ODBC Data Sources到内存的操作
* @author:narsh
* @time 2010-2-8
*/
public class getRegToMemery {
publ ......
首先需要知道的是,MP3文件的文件信息都放在文件最后的128个字节里面,这128个字节分别存储的信息如下:
char Header[3]; /* 标签头必须是"TAG"否则认为没有标签 */
char Title[30]; /* 标题 */
char Artist[30]; /* 作者&n ......
使用类java.io.File
1.获取系统硬盘信息:
public static String getDiskInfo() {
StringBuffer sb=new StringBuffer();
File[] roots = File.listRoots();// 获取磁盘分区列表
for (File file : roots) {
long totalSpace=file.getTotalSpace();
long freeSpace=file.getFreeSpace();
long usa ......
一、Axis安装 1、环境 J2SE SDK 1.5 or 1.6: 我使用 1.6 Servlet Container: 我使用的Tomcat 6.0
2、到 http://ws.apache.org/Axis/网站下载Axis安装包
3、先在eclipse下新建web project为WebServiceDemo.在Tomcat的配置xml配置上:<Context path="/webservice" docBase="D:\workspace\WebServiceDemo\WebRoot"/>. ......