nicko 2004/08/22 17:07:23
Modified: src/Util SystemInfo.cs
Log:
Process.StartTime not supported on NETCF or SSCLI
Revision Changes Path
1.7 +8 -0 logging-log4net/src/Util/SystemInfo.cs
Index: SystemInfo.cs
===================================================================
RCS file: /home/cvs/logging-log4net/src/Util/SystemInfo.cs,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- SystemInfo.cs 19 Aug 2004 22:26:31 -0000 1.6
+++ SystemInfo.cs 23 Aug 2004 00:07:23 -0000 1.7
@@ -281,6 +281,13 @@
{
if (s_processStartTime == DateTime.MinValue)
{
+#if (NETCF || SSCLI)
+ // NETCF does not have the
System.Diagnostics.Process class
+ // SSCLI does not support StartTime
property in System.Diagnostics.Process
+
+ // Use the time of the first call as
the start time
+ s_processStartTime = DateTime.Now;
+#else
try
{
s_processStartTime =
System.Diagnostics.Process.GetCurrentProcess().StartTime;
@@ -290,6 +297,7 @@
// Unable to get the start
time, use now as the start time
s_processStartTime =
DateTime.Now;
}
+#endif
}
return s_processStartTime;
}