markus / MarkupToPDF / Common / GetUserSign.cs @ 038c77fd
이력 | 보기 | 이력해설 | 다운로드 (2.43 KB)
1 | 787a4489 | KangIngu | using KCOMDataModel.Common; |
---|---|---|---|
2 | using KCOMDataModel.DataModel; |
||
3 | using System; |
||
4 | using System.Collections.Generic; |
||
5 | using System.IO; |
||
6 | using System.Linq; |
||
7 | e52385b9 | ljiyeon | using System.Runtime.InteropServices; |
8 | 2aac9b2b | djkim | using System.ServiceModel; |
9 | 787a4489 | KangIngu | using System.Text; |
10 | |||
11 | namespace MarkupToPDF.Common |
||
12 | { |
||
13 | public class GetUserSign |
||
14 | { |
||
15 | e52385b9 | ljiyeon | /// |
16 | c247e6b4 | humkyung | /// <summary> |
17 | e52385b9 | ljiyeon | /// Application Data Folder |
18 | /// </summary> |
||
19 | /// |
||
20 | public static string AppDataFolder |
||
21 | { |
||
22 | get |
||
23 | { |
||
24 | return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), "MARKUS"); |
||
25 | } |
||
26 | } |
||
27 | |||
28 | [DllImport("kernel32")] |
||
29 | private static extern int GetPrivateProfileString(string section, string key, string def, StringBuilder retVal, int size, string filePath); |
||
30 | |||
31 | 5529d2a2 | humkyung | /// <summary> |
32 | c247e6b4 | humkyung | /// get signature of given user of given project |
33 | /// </summary> |
||
34 | /// <param name="UserID"></param> |
||
35 | /// <param name="ProjectNo"></param> |
||
36 | /// <returns></returns> |
||
37 | 661b7416 | humkyung | public static string GetSign(string UserID, string ProjectNo) |
38 | 787a4489 | KangIngu | { |
39 | 661b7416 | humkyung | BasicHttpBinding _binding; |
40 | EndpointAddress _EndPoint; |
||
41 | |||
42 | 2aac9b2b | djkim | _binding = new BasicHttpBinding(BasicHttpSecurityMode.TransportCredentialOnly); |
43 | _binding.MaxBufferSize = 2147483647; |
||
44 | _binding.MaxReceivedMessageSize = 2147483647; |
||
45 | _binding.OpenTimeout = new TimeSpan(0, 1, 0); |
||
46 | _binding.ReceiveTimeout = new TimeSpan(0, 10, 0); |
||
47 | _binding.CloseTimeout = new TimeSpan(0, 5, 0); |
||
48 | _binding.SendTimeout = new TimeSpan(0, 5, 0); |
||
49 | _binding.TextEncoding = System.Text.Encoding.UTF8; |
||
50 | e52385b9 | ljiyeon | _binding.TransferMode = TransferMode.Buffered; |
51 | |||
52 | StringBuilder BaseClientAddress = new StringBuilder(512); |
||
53 | f001add7 | ljiyeon | GetPrivateProfileString("BaseClientAddress", "URL", "(NONE)", BaseClientAddress, 512, Path.Combine(AppDataFolder, "MARKUS.ini")); |
54 | e52385b9 | ljiyeon | |
55 | //string sBaseServiceURL = global::MarkupToPDF.Properties.Settings.Default.BaseClientAddress; |
||
56 | string sBaseServiceURL = BaseClientAddress.ToString(); |
||
57 | c247e6b4 | humkyung | |
58 | 2aac9b2b | djkim | _EndPoint = new EndpointAddress(string.Format("{0}/ServiceDeepView.svc", sBaseServiceURL)); |
59 | |||
60 | markus_api.ServiceDeepViewClient client = new markus_api.ServiceDeepViewClient(_binding, _EndPoint); |
||
61 | var _sign = client.GetSignData(ProjectNo, UserID); |
||
62 | |||
63 | return _sign; |
||
64 | 787a4489 | KangIngu | } |
65 | } |
||
66 | 5529d2a2 | humkyung | } |