我應該如何透過程式對VI進行密碼保護?
主要軟體:
主要軟體版本:
主要軟體修正版本:
次要軟體:
問題: 我想對一個目錄下的VI通過程式進行密碼保護,應該如何做到這一點呢?
解答: 你要使用VI Server技術,步驟如下:
- 使用 Open VI Reference來調用你想進行密碼保護的VI. 在 VI path 輸入端,你要輸入這個VI所在的路徑。
- 使用一個 invoke node,選中Set Lock State方法. 這裏會有四個參數:
- Lock State: 選擇 Password protected.
- Interactive: 選擇 false 常數.
- Password: 輸入這個VI的新的密碼
- Put in cache: 輸入 true 常數
- 使用另外一個 invoke node ,選擇 Save Instrument方法. 我們需要使用這個VI來保存我們對這個VI所作的修改。
- 使用 Close LV Object Reference 釋放對這個VI的呼叫。
相關連結: KB 297AL34U: How Can I Programmatically Save an Unsaved VI?
附加檔案:
報告日期: 11/12/2002
最後更新: 01/07/2005
文件偏號: 2RBAM5RY
Other Support Options
Ask the NI Community
Collaborate with other users in our discussion forums
Request Support from an Engineer
A valid service agreement may be required, and support options vary by country.