Created
June 9, 2016 06:41
-
-
Save pegasuskim/eaf60123af1adab1742394b02e17b34d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Runtime.InteropServices; | |
using RDPCOMAPILib; | |
RDPSession currentSession = new RDPSession(); | |
public static void RDPConnect() | |
{ | |
if(currentSession != null) | |
{ | |
currentSession.OnAttendeeConnected += Incoming; | |
currentSession.Open(); | |
} | |
} | |
public static void RDPDisconnect() | |
{ | |
if (currentSession != null) | |
{ | |
currentSession.Close(); | |
Marshal.ReleaseComObject(currentSession); | |
currentSession = null; | |
// 가비지 컬렉터 호출 해서 메모리 회수 | |
GC.Collect(); | |
} | |
} | |
public static string ConnectionString(String authString, string group, string password, int clientLimit) | |
{ | |
invitation = currentSession.Invitations.CreateInvitation(authString, group, password, clientLimit); | |
return invitation.ConnectionString; | |
} | |
private static void Incoming(object Guest) | |
{ | |
IRDPSRAPIAttendee MyGuest = (IRDPSRAPIAttendee)Guest; | |
// CTRL_LEVEL_VIEW 지정 | |
MyGuest.ControlLevel = CTRL_LEVEL.CTRL_LEVEL_VIEW; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment