View Single Post
ישן 26-11-11, 19:37   # 6
Erez | TrustMedia.co.il
עסק רשום [?]
 
מיני פרופיל
תאריך הצטרפות: Jul 2008
הודעות: 1,854

Erez | TrustMedia.co.il לא מחובר  

קוד:
FILECHOOSE:

JFileChooser fc = new JFileChooser();
fc.showOpenDialog(null);
String response = Fingerprint.getFingerPrint(fc.getSelectedFile().getAbsolutePath());

FINGERPRINT:

static String getFingerPrint(String path) {
	try {
		Runtime rt = Runtime.getRuntime();
		Process pr = rt.exec("cmd /A /c \"cd lastfmclient && lastfmfpclient -nometadata \""+path+"\"\"");
		 
		BufferedReader input = new BufferedReader(new InputStreamReader(pr.getInputStream()));
		 
		String line=null;
		while((line=input.readLine()) != null) {
		   System.out.println(line);
		}
		
    } catch(Exception e) {
		return e.toString();
    }
}
החלק הראשון זה החלק שמקבל את הנתיב של הקובץ שהמשתמש בחר, והחלק השני זה הקוד שמקבל את הקובץ ומדפיס את הפלט של התוכנית שאני משתמש בה כדי לעבד את הקובץ.
אבל כמו שאמרתי בעברית זה עובד ובאנגלית זה לא. ניסיתי גם ידנית מהCMD לרשום לו שם את הנתיב בעברית (הוא שינה לג'יבריש) וזה גם לא עבד. ניסיתי בהגדרות של השורה שזה ירוץ ביוניקוד וגם בASCII (ה\A שמופיע בשורת הפקודה בקוד) ולא עזר :/

תודה על העזרה
__________________
  Reply With Quote