第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

Java Runtime.exe()不返回PowerShell命令輸出

Java Runtime.exe()不返回PowerShell命令輸出

狐的傳說 2021-04-06 21:20:54
我嘗試使用Java Runtime.exe在命令下方運(yùn)行String command ="powershell (Get-item  \"D:\\test\" ).creationtime.ToString(\"yyyy-MM-dd'T'HH:mm:ss\")";當(dāng)我在Windows命令提示符上運(yùn)行它時(shí),它返回“ 2017-08-07T20:03:00”。但是,當(dāng)我在myMethod中運(yùn)行該程序時(shí),該程序也正在運(yùn)行,并且什么也沒有返回給我。myMethode:private static void executePowerShellCommand(String command) {    String line = "";    command = "cmd /c " + command;    try {         Process process = Runtime.getRuntime().exec(command);         process.getOutputStream().close();         BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream()));         while ((line = reader.readLine()) != null) {             System.out.println(line);         }         reader.close();         System.out.println("Done");         } catch (java.io.IOException e) {             e.printStackTrace();         }        return;}
查看完整描述

1 回答

  • 1 回答
  • 0 關(guān)注
  • 354 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)