Hi Zsolt,
At this moment we do not support reading from or writing events to a remote computer. Gert From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Zsolt Molnar Sent: donderdag 15 februari 2007 8:21 To: [email protected] Subject: [Mono-list] Mono and EventLog Hi All, Could anybody give advice how to manage the EvenLogs of Windows computers and servers from Mono under Linux ?? Here is a sample code which works fine under Windows but nothing happen when I run under Linux and I don't get any error message. Of course I tried the machine name with Windows machine's IP address. using System; using System.Text; using System.Diagnostics; class Program { static void Main() { string myRemoteMachine; string myLogName = "MyLog"; Console.Write("Enter computer on which to create log : "); myRemoteMachine = Console.ReadLine(); // Check if the source exists. if (!EventLog.SourceExists("MyTestSource")) { //Create source. EventLog.CreateEventSource("MyTestSource", myLogName, myRemoteMachine); Console.WriteLine("Creating EventSource"); } else // Get the EventLog associated if the source exists. myLogName = EventLog.LogNameFromSourceName("MyTestSource", myRemoteMachine); EventLog myEventLog1 = new EventLog(myLogName, myRemoteMachine); myEventLog1.Source = "MyTestSource"; // Write an entry into log. myEventLog1.WriteEntry("This is for your information", EventLogEntryType.SuccessAudit, 100); Console.WriteLine("An EventLog created on computer " + myEventLog1.MachineName); Console.Write("Enter remote computer on which to create log : "); myRemoteMachine = Console.ReadLine(); EventLog myEventLog2 = new EventLog(); myEventLog2.MachineName = myRemoteMachine; myEventLog2.Source = "MyTestSource"; myEventLog2.Log = myEventLog1.LogDisplayName; myEventLog2.WriteEntry("This is for your information"); Console.WriteLine("An EventLog created on computer " + myEventLog2.MachineName); } } Best Regards,
_______________________________________________ Mono-list maillist - [email protected] http://lists.ximian.com/mailman/listinfo/mono-list
