- 先建立連線 Remote 連線
//建立遠端連線 ConnectionOptions remoteCon = new ConnectionOptions(); remoteCon.Username =Account; remoteCon.Password = Password; //如果為NULL,則已電腦的網域為預設值 //remoteCon.Authority = "ntdlmdomain:DOMAIN"; //取得或設定 COM 驗證等級,以使用於這個連接中的作業。 remoteCon.Authentication = AuthenticationLevel.PacketPrivacy; //指出是否需要為連接作業啟用使用者權限。在執行的作業需要啟用某些使用者權限時 (例如,電腦重新開機) 才應該使用這個屬性。 remoteCon.EnablePrivileges = true;