客戶要求一個遠程協助軟件. 用於局域網內部使用.
幾經比對篩選, 還是基於TeamViewer的封裝實現
方案是通過句柄獲取Teamviewer內控件. 然後修改內部參數或是模擬鼠標點擊
後面發現Teamviewer可以帶參數.
-i <ID>
(Mandatory) ID of the remote computer
--Password <password> -P <password>
(Optional) password of the remote computer – you will be prompted for the password if this is not used
-m fileTransfer -m vpn
(Optional) connection mode – this defaults to Remote Control if not used
詳細參考: https://community.teamviewer.com/t5/Knowledge-Base/Command-line-parameters/ta-p/34447
然後將Teamviewer的遠程界面嵌入到自己的form中
IntPtr maindHwnd = FindWindow("TV_CClientWindowClass", null); //獲得句柄
if (maindHwnd != IntPtr.Zero)
{
SetParent(maindHwnd, this.Handle);
ShowWindow(maindHwnd, 1);
}