我需要使用shell從文件傳遞密碼短語,並且希望註釋行可以從此文件讀取密碼短語,--passphrase-fd對我不起作用。它總是輸出一個錯誤「找不到文件」。我調試輸出和輸入文件,它們是正確的。可能是passphrase.cat文件,但我檢查過,文件中沒有問題。評論欄中的任何問題?使用gpg傳遞密碼文件來解密文件
我的代碼如下,感謝您的幫助:
Shell(pgp & "--passphrase -fd 0 <C:\Temp\test.txt" & " -output " & output & "--decrypt " & input & """", AppWinStyle.Hide, True) ' the error happens here.
End If
''' The error as follows:
''' Unable to complete the request: System.IO.FileNotFoundException: File not found. at Microsoft.VisualBasic.Interaction.Shell(String PathName, AppWinStyle Style, Boolean Wait, Int32 Timeout) at the Sign_Click(object sender, EventArgs e) in C:\sign\MainForm.vb:line361
執行的確切命令行是什麼(換句話說,「Shell(...)」的字符串參數是什麼),以及接收到的確切完整的錯誤消息是什麼?你是否驗證過這個文件是真正寫入的? –
@JensErat嗨,我在命令中傳遞的字符串是「C:\ Temp \ test.cat」,輸出和輸入。輸出==(txtRequestDestination.Text&foundFileInfo.Name).Remove((txtRequestDestination.Text)。Input = txtRequestSource.Text&foundFileInfo.Name。錯誤提示「無法找到文件」。 – ccy
@JensErat我測試了這三個參數,但所有文件都存在。「Shell(pgp&」--passphrase -fd 0
ccy