2 using System.Runtime.InteropServices;
5 // this attribute has NO effect on LinkDemand!
6 [SuppressUnmanagedCodeSecurity]
10 [DllImport ("libc", SetLastError=true)]
11 public static extern uint getuid ();
14 [DllImport ("kernel32.dll", SetLastError=true)]
15 public static extern uint GetTickCount ();
17 static bool RunningOnMono ()
19 bool mono = (Type.GetType ("Mono.Math.BigInteger") != null);
20 Console.WriteLine ("Running on {0} runtime...", mono ? "Mono" : "Microsoft");
27 uint u = (RunningOnMono ()) ? getuid () : GetTickCount ();
28 Console.WriteLine ("*0* P/Invoke: {0}", u);
31 catch (SecurityException se) {
32 Console.WriteLine ("*1* Unexpected SecurityException\n{0}", se);
36 Console.WriteLine ("*2* Unexpected exception\n{0}", e);