File tree Expand file tree Collapse file tree 2 files changed +18
-7
lines changed
Expand file tree Collapse file tree 2 files changed +18
-7
lines changed Original file line number Diff line number Diff line change 1- /.vs /RemoteDesktopService /v14 /* .suo
1+ * .user
2+
3+ bin
4+
5+ obj
6+
7+ .vs
8+ * .suo
Original file line number Diff line number Diff line change @@ -10,12 +10,11 @@ public partial class RemoteAppDesktopService : ServiceBase
1010 {
1111 #region Service Template
1212 public RegistryMonitor Thread ;
13-
1413 public RemoteAppDesktopService ( )
1514 {
1615 InitializeComponent ( ) ;
17-
1816 _GetEventLog ( ) ;
17+
1918 Thread = new RegistryMonitor ( this , this . ApplicationEventLog ) ;
2019 }
2120
@@ -38,13 +37,18 @@ protected override void OnStop()
3837 #region Service Methods
3938 protected void _GetEventLog ( )
4039 {
41- if ( ! EventLog . SourceExists ( "DesktopAppMonitor" ) )
40+ try
4241 {
43- EventLog . CreateEventSource ( "RemoteApp Desktop Monitor" , "Application" ) ;
42+ if ( ! EventLog . SourceExists ( "RemoteApp Desktop Monitor" ) )
43+ {
44+ EventLog . CreateEventSource ( "RemoteApp Desktop Monitor" , "Application" ) ;
45+ }
46+
47+ this . ApplicationEventLog . Source = "RemoteApp Desktop Monitor" ;
48+ this . ApplicationEventLog . Log = "Application" ;
4449 }
50+ catch ( Exception ) { }
4551
46- this . ApplicationEventLog . Source = "RemoteApp Desktop Monitor" ;
47- this . ApplicationEventLog . Log = "Application" ;
4852 }
4953 #endregion Service Methods
5054 }
You can’t perform that action at this time.
0 commit comments