Click here to Skip to main content
16,006,768 members
Home / Discussions / C#
   

C#

 
GeneralRe: File Security Pin
Luc Pattyn20-Apr-10 8:31
sitebuilderLuc Pattyn20-Apr-10 8:31 
AnswerRe: File Security Pin
Dave Kreskowiak20-Apr-10 11:11
mveDave Kreskowiak20-Apr-10 11:11 
AnswerRe: File Security Pin
AspDotNetDev20-Apr-10 13:01
protectorAspDotNetDev20-Apr-10 13:01 
QuestionMessage Removed Pin
20-Apr-10 3:13
Tunisien8620-Apr-10 3:13 
JokeRe: Create and connect my checklistBox with my local database in csharp smart device project Pin
Michel Godfroid20-Apr-10 3:36
Michel Godfroid20-Apr-10 3:36 
GeneralRe: Create and connect my checklistBox with my local database in csharp smart device project Pin
Tunisien8620-Apr-10 3:42
Tunisien8620-Apr-10 3:42 
GeneralRe: Create and connect my checklistBox with my local database in csharp smart device project Pin
Michel Godfroid20-Apr-10 4:04
Michel Godfroid20-Apr-10 4:04 
QuestionWindows Desktop Sharing as service... Pin
Jacob Dixon20-Apr-10 3:10
Jacob Dixon20-Apr-10 3:10 
So I was taking a look into Windows Desktop Sharing and have found an example that I have downloaded and tested on my machine. The issue is the one I downloaded is a client and server that are both Windows Forms (not a service).

So I attempted to try a service.

When I run my service as LOCAL SYSTEM (with access to desktop) it will connect but will automatically go to the black screen with a PAUSE symbol on it. If I run the service as a NETWORK SERVICE I get an error code of 1028... if I run the service as a DOMAIN admin user I get an error of 2308.

Server:
protected RDPSession _rdpSession = null;
private string invitation;

public ITMgmt()
{
    InitializeComponent();
}

protected override void OnStart(string[] args)
{
    _rdpSession = new RDPSession();
    _rdpSession.OnAttendeeConnected += new _IRDPSessionEvents_OnAttendeeConnectedEventHandler(OnAttendeeConnected);
    _rdpSession.OnAttendeeDisconnected += new _IRDPSessionEvents_OnAttendeeDisconnectedEventHandler(OnAttendeeDisconnected);
    _rdpSession.OnControlLevelChangeRequest += new _IRDPSessionEvents_OnControlLevelChangeRequestEventHandler(OnControlLevelChangeRequest);

    _rdpSession.Open();
    IRDPSRAPIInvitation pInvitation = _rdpSession.Invitations.CreateInvitation("WinPresenter", "PresentationGroup", "", 5);
    invitation = pInvitation.ConnectionString;

    using (StreamWriter sw = File.CreateText("c:\\inv.xml"))
    {
        sw.WriteLine(invitation);
    }

}

private void OnAttendeeConnected(object Attendee)
{
    IRDPSRAPIAttendee pAttendee = Attendee as IRDPSRAPIAttendee;
    pAttendee.ControlLevel = CTRL_LEVEL.CTRL_LEVEL_VIEW;
    EventLog.WriteEntry("IT Management", "Connected: " + pAttendee.RemoteName, EventLogEntryType.Information);
}

private void OnAttendeeDisconnected(object Attendee)
{
    IRDPSRAPIAttendee pAttendee = Attendee as IRDPSRAPIAttendee;
    EventLog.WriteEntry("IT Management", "Disconnected: " + pAttendee.RemoteName, EventLogEntryType.Information);
}

private void OnControlLevelChangeRequest(object pObjAttendee, CTRL_LEVEL RequestedLevel)
{
}


I can't seem to attach visual studio to the service either. Keep saying there is a debugger already attached? I install the service with visual studios command prompt (installutil).

Anyways if you have any idea why this would work as a windows form and not this service please let me know. I do want to point out that you can see I have a event when a attendee connected and it actually fires because my event log does show that the user connected.

OS: Windows 7
VS: 2008

Client & Server on same computer at this point. Works with 2 windows forms this way.
AnswerRe: Windows Desktop Sharing as service... Pin
Michel Godfroid20-Apr-10 3:57
Michel Godfroid20-Apr-10 3:57 
GeneralRe: Windows Desktop Sharing as service... Pin
Jacob Dixon20-Apr-10 4:23
Jacob Dixon20-Apr-10 4:23 
GeneralRe: Windows Desktop Sharing as service... Pin
Michel Godfroid20-Apr-10 6:33
Michel Godfroid20-Apr-10 6:33 
QuestionWM_PAINT message in textbox Pin
thomus0720-Apr-10 3:02
thomus0720-Apr-10 3:02 
AnswerRe: WM_PAINT message in textbox Pin
Luc Pattyn20-Apr-10 3:38
sitebuilderLuc Pattyn20-Apr-10 3:38 
GeneralRe: WM_PAINT message in textbox Pin
thomus0720-Apr-10 3:46
thomus0720-Apr-10 3:46 
Questionhow can i show progress in Progress bar on MDI form from child form Pin
wasifmuneer19-Apr-10 21:58
wasifmuneer19-Apr-10 21:58 
AnswerRe: how can i show progress in Progress bar on MDI form from child form Pin
Anindya Chatterjee20-Apr-10 0:09
Anindya Chatterjee20-Apr-10 0:09 
AnswerRe: how can i show progress in Progress bar on MDI form from child form Pin
StM0n20-Apr-10 1:05
StM0n20-Apr-10 1:05 
AnswerRe: how can i show progress in Progress bar on MDI form from child form Pin
wasifmuneer20-Apr-10 20:35
wasifmuneer20-Apr-10 20:35 
QuestionJPEG deinterlacing Pin
Chesnokov Yuriy19-Apr-10 21:13
professionalChesnokov Yuriy19-Apr-10 21:13 
QuestionRe: JPEG deinterlacing Pin
Chesnokov Yuriy19-Apr-10 22:16
professionalChesnokov Yuriy19-Apr-10 22:16 
QuestionExporting Datagridview Headers to excel Pin
ZiggyNet19-Apr-10 20:33
ZiggyNet19-Apr-10 20:33 
AnswerRe: Exporting Datagridview Headers to excel Pin
Mycroft Holmes19-Apr-10 22:40
professionalMycroft Holmes19-Apr-10 22:40 
RantRe: Exporting Datagridview Headers to excel Pin
ZiggyNet20-Apr-10 3:46
ZiggyNet20-Apr-10 3:46 
GeneralRe: Exporting Datagridview Headers to excel Pin
Mycroft Holmes20-Apr-10 12:25
professionalMycroft Holmes20-Apr-10 12:25 
QuestionWhy the form be changed? [modified][Solved] Pin
yu-jian19-Apr-10 20:21
yu-jian19-Apr-10 20:21 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.