C#的方法
-
安裝 pythonnet
pip install pythonnet
(不要安裝 clr,要先移除) -
載入內容為 keyence SR-X300
Communication.dll
Keyence.AutoID.SDK.dll
VncClientControlCommon.dll
VncClientControlCommonLib.dll -
程式寫法:
import clr
import sys
sys.path.append(‘C:/My/Path/To/The/DLLs/Folder’)
clr.AddReference(“Keyence.AutoID.SDK.dll”) --> 有問題
clr.AddReference(“Keyence.AutoID.SDK”) -->正確 -
遇到
*System.NotSupportedException: 嘗試從在舊版 .NET Framework 中會導致以沙箱處理組件的網路位置載入組件
*要安裝 VC_redist.x64.exe (版本要對,有 32/64 差異。
*DLL 版本也要確認 32/64 差異- 檔案路徑要對