using System;
using System.Runtime.InteropServices;
class LowLevelAPISample
{
[DllImport("dgsdk.dll")]
static extern int ShortRandom(int from, int to);
[DllImport("dgsdk.dll")]
static extern string DateRandom(string format,string from,string to);
[DllImport("dgsdk.dll")]
static extern string TimeRandom(string format,string from,string to);
public static void Main()
{
int i;
Console.WriteLine("Short\tDate\tTime");
for(i=0; i<20; i++)
{
Console.WriteLine("{0}\t{1}\t{2}",
ShortRandom(100,200),
DateRandom("DD.MM.YYYY","01.01.2000","31.12.2009"),
TimeRandom("HH:MM:SS","00:00:00","23:59:59"));
}
}
}
|
Short Date Time
160 12.12.2004 04:29:04
119 19.07.2002 08:05:05
127 02.04.2001 11:55:02
165 28.01.2001 12:02:33
182 23.11.2001 20:38:35
181 18.07.2001 18:09:52
165 18.08.2005 06:23:51
172 03.10.2003 08:21:31
114 24.05.2007 20:22:57
137 28.08.2003 21:49:58
175 17.12.2000 18:48:46
126 11.03.2004 16:26:45
108 21.10.2000 14:06:21
159 04.09.2009 23:24:34
163 07.09.2006 08:11:28
108 25.04.2006 19:17:58
173 09.07.2009 05:33:35
120 20.07.2004 18:57:26
196 24.07.2001 17:44:52
113 01.10.2007 21:57:12
|