2 using System.Runtime.InteropServices;
8 [DllImport ("libc", SetLastError=true)]
9 public static extern uint getuid ();
12 [DllImport ("kernel32.dll", SetLastError=true)]
13 public static extern uint GetTickCount ();
15 static bool RunningOnWindows ()
17 bool win = ((int) Environment.OSVersion.Platform != 128);
18 Console.WriteLine ("Running on {0}...", Environment.OSVersion);
25 uint u = (RunningOnWindows () ? GetTickCount () : getuid ());
26 Console.WriteLine ("*0* P/Invoke: {0}", u);
29 catch (SecurityException se) {
30 Console.WriteLine ("*1* Unexpected SecurityException\n{0}", se);
34 Console.WriteLine ("*2* Unexpected exception\n{0}", e);