markus / GuidTest / Program.cs @ 97a17f3a
이력 | 보기 | 이력해설 | 다운로드 (1.05 KB)
1 |
using KCOM.Common; |
---|---|
2 |
using System; |
3 |
using System.Collections.Generic; |
4 |
using System.Linq; |
5 |
using System.Text; |
6 |
using System.Threading.Tasks; |
7 |
|
8 |
namespace GuidTest |
9 |
{ |
10 |
class Program |
11 |
{ |
12 |
static List<string> newGuids = new List<string>(); |
13 |
static List<string> oldGuids = new List<string>(); |
14 |
|
15 |
static void Main(string[] args) |
16 |
{ |
17 |
while (true) |
18 |
{ |
19 |
var newId = Commons.shortGuid(); |
20 |
|
21 |
if (!newGuids.Contains(newId)) |
22 |
{ |
23 |
newGuids.Add(newId); |
24 |
} |
25 |
else |
26 |
{ |
27 |
throw new Exception("newguid Common"); |
28 |
} |
29 |
|
30 |
var oldId = Commons.shortGuidold(); |
31 |
|
32 |
if (!oldGuids.Contains(oldId)) |
33 |
{ |
34 |
oldGuids.Add(oldId); |
35 |
} |
36 |
else |
37 |
{ |
38 |
throw new Exception("oldGuid Common"); |
39 |
} |
40 |
|
41 |
System.Threading.Thread.Sleep(100); |
42 |
} |
43 |
|
44 |
} |
45 |
} |
46 |
} |