[問題] Java 路徑字串問題
當路徑有二個空白時例如a b.mp3
String str = "c:\\a b.mp3";
try {
// System.out.println(str);
System.out.println("rundll32 SHELL32.DLL,ShellExec_RunDLL \"" +
str + "\"");
Runtime.getRuntime().exec("rundll32 SHELL32.DLL,ShellExec_RunDLL
\"" + str + "\"");//+ new File(str));
} catch (Exception ex) {
System.out.println(ex);
}
會得到一個windows找不到檔案或路徑的訊息
請問除了改路徑外有啥解法 謝謝!
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 1.200.114.120
推
11/22 11:44, , 1F
11/22 11:44, 1F
→
11/22 11:44, , 2F
11/22 11:44, 2F
→
11/22 12:46, , 3F
11/22 12:46, 3F
→
11/22 12:48, , 4F
11/22 12:48, 4F
→
11/22 12:53, , 5F
11/22 12:53, 5F
→
11/22 14:55, , 6F
11/22 14:55, 6F
討論串 (同標題文章)