markus / KCOM / Common / Check_Uri.cs @ 96bc6e8e
이력 | 보기 | 이력해설 | 다운로드 (707 Bytes)
1 | e1fb3d16 | ljiyeon | using System; |
---|---|---|---|
2 | using System.Collections.Generic; |
||
3 | using System.Linq; |
||
4 | using System.Text; |
||
5 | using System.Threading.Tasks; |
||
6 | |||
7 | namespace KCOM.Common |
||
8 | { |
||
9 | class Check_Uri |
||
10 | { |
||
11 | 0beae8fb | djkim | public static void UriCheck(string uristring) |
12 | e1fb3d16 | ljiyeon | { |
13 | 0beae8fb | djkim | if (!(Uri.TryCreate(uristring, UriKind.Absolute, out Uri uri) && uri.Scheme == Uri.UriSchemeHttp)) |
14 | e1fb3d16 | ljiyeon | { |
15 | throw new Exception(); |
||
16 | } |
||
17 | } |
||
18 | d71b4688 | ljiyeon | |
19 | 0beae8fb | djkim | public static bool isUri(string uristring) |
20 | d71b4688 | ljiyeon | { |
21 | 0beae8fb | djkim | if (!(Uri.TryCreate(uristring, UriKind.Absolute, out Uri uri) && uri.Scheme == Uri.UriSchemeHttp)) |
22 | d71b4688 | ljiyeon | { |
23 | return false; |
||
24 | } |
||
25 | return true; |
||
26 | } |
||
27 | e1fb3d16 | ljiyeon | } |
28 | } |