String file="f:\mp3\i love you.mp3";
Runtime.getRuntime().exec("cmd /c start \"" + file + "\"");
//将空格的左边和右边加上双引号:
Runtime.getRuntime().exec("cmd /c start " + file.replaceAll(" ", "\" \""));
posted on 2008-08-31 19:02 一杯清茶 阅读(232) 评论(0) 编辑 收藏 所属分类: 编程炼狱
Powered by: BlogJava Copyright © 一杯清茶