프로젝트

일반

사용자정보

개정판 eb5cdefc

IDeb5cdefc0621f77d06c1395e0ef19b9b0632032d
상위 22c025b3
하위 e7a49eb7, 5aaf27a2

김동진이(가) 5년 이상 전에 추가함

issue #000 daelim merged

Change-Id: I7b584bc84d283ab0c9415fd0b7ddbea8362d60a3

차이점 보기:

CommonLib/CommonLib.csproj
42 42
  </ItemGroup>
43 43
  <ItemGroup>
44 44
    <Compile Include="Common.cs" />
45
    <Compile Include="DNSHelper.cs" />
45 46
    <Compile Include="Properties\AssemblyInfo.cs" />
46 47
  </ItemGroup>
47 48
  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
CommonLib/DNSHelper.cs
1
using System;
2
using System.Collections.Generic;
3
using System.Linq;
4
using System.Net;
5
using System.Net.NetworkInformation;
6
using System.Text;
7
using System.Threading.Tasks;
8

  
9
namespace CommonLib
10
{
11
    public class DNSHelper
12
    {
13
        public static IPAddress GetDnsAdress()
14
        {
15
            NetworkInterface[] networkInterfaces = NetworkInterface.GetAllNetworkInterfaces();
16

  
17
            foreach (NetworkInterface networkInterface in networkInterfaces)
18
            {
19
                if (networkInterface.OperationalStatus == OperationalStatus.Up)
20
                {
21
                    IPInterfaceProperties ipProperties = networkInterface.GetIPProperties();
22
                    IPAddressCollection dnsAddresses = ipProperties.DnsAddresses;
23

  
24
                    foreach (IPAddress dnsAdress in dnsAddresses)
25
                    {
26
                        return dnsAdress;
27
                    }
28
                }
29
            }
30
            return null;
31
        }
32
    }
33
}
KCOM/App.xaml.cs
167 167

  
168 168
                string sBaseServiceURL = string.Empty;//CommonLib.Common.GetConfigString("BaseClientAddress", "URL", "");
169 169
                string localdomain = CommonLib.Common.GetConfigString("HOST_DOMAIN", "DOMAIN", "");
170
                var ipaddress = DNSHelper.GetDnsAdress();
170
                var ipaddress = CommonLib.DNSHelper.GetDnsAdress();
171 171

  
172 172
                try
173 173
                {
......
185 185
                }
186 186

  
187 187
#if DEBUG
188
                //sBaseServiceURL = CommonLib.Common.GetConfigString("BaseClientAddress", "URL", "", isExternal);
188 189
                sBaseServiceURL = CommonLib.Common.GetConfigString("Debug_BaseClientAddress", "URL", "");
189 190
#else
190 191
                sBaseServiceURL = CommonLib.Common.GetConfigString("BaseClientAddress", "URL", "", isExternal);
191 192
#endif
193
                                
192 194
                _EndPoint = new EndpointAddress(string.Format("{0}/ServiceDeepView.svc", sBaseServiceURL));
193 195

  
194 196
                if (Environment.Is64BitProcess == true) //64 bit machine
KCOM/Common/DNSHelper.cs
1
using System;
2
using System.Collections.Generic;
3
using System.Linq;
4
using System.Net;
5
using System.Net.NetworkInformation;
6
using System.Text;
7
using System.Threading.Tasks;
8

  
9
namespace KCOM.Common
10
{
11
    public class DNSHelper
12
    {
13
        public static IPAddress GetDnsAdress()
14
        {
15
            NetworkInterface[] networkInterfaces = NetworkInterface.GetAllNetworkInterfaces();
16

  
17
            foreach (NetworkInterface networkInterface in networkInterfaces)
18
            {
19
                if (networkInterface.OperationalStatus == OperationalStatus.Up)
20
                {
21
                    IPInterfaceProperties ipProperties = networkInterface.GetIPProperties();
22
                    IPAddressCollection dnsAddresses = ipProperties.DnsAddresses;
23

  
24
                    foreach (IPAddress dnsAdress in dnsAddresses)
25
                    {
26
                        return dnsAdress;
27
                    }
28
                }
29
            }
30
            return null;
31
        }
32
    }
33
}
KCOM/KCOM.csproj
258 258
    <Compile Include="Common\Converter\PDFVisibleConverter.cs" />
259 259
    <Compile Include="Common\Converter\SvgConverter.cs" />
260 260
    <Compile Include="Common\Converter\SvgImageConverter.cs" />
261
    <Compile Include="Common\DNSHelper.cs" />
262 261
    <Compile Include="Common\FileStreamToBase64.cs" />
263 262
    <Compile Include="Common\SelectionSet.cs" />
264 263
    <Compile Include="Common\TempFile.cs" />
KCOM/Services/BaseServices.cs
23 23
{
24 24
    public partial class MainMenu : UserControl, INotifyPropertyChanged
25 25
    {
26
        const string DeepZoomUrl = @"http://{baseUrl}/TileSource/{TileSourcePath}/{ItemsPath}/{SharepointItemID}/{PageNo}.jpg";
26
        //const string DeepZoomUrl = @"http://{baseUrl}/TileSource/{TileSourcePath}/{ItemsPath}/{SharepointItemID}/{PageNo}.jpg";
27 27
        public ServiceDeepViewClient BaseClient;
28 28
        public ViewInfo _ViewInfo;
29 29
        public DOCINFO _DocInfo;
......
218 218
                return;
219 219
            }
220 220

  
221
            var MainUrl = DeepZoomUrl.Replace("{baseUrl}", App.SystemInfo.HostName);
222
            MainUrl = MainUrl.Replace("{TileSourcePath}", _ViewInfo.ProjectNO + "_Tile");
223
            MainUrl = MainUrl.Replace("{ItemsPath}", (Convert.ToInt64(_ViewInfo.DocumentItemID) / 100).ToString());
224
            MainUrl = MainUrl.Replace("{SharepointItemID}", _ViewInfo.DocumentItemID);
225
            MainUrl = MainUrl.Replace(@"http://http://", @"http://");
226

  
221
            var MainUrl = string.Format(CommonLib.Common.GetConfigString("mainServerImageWebPath", "URL", "", App.isExternal).Replace("png","jpg"), _ViewInfo.ProjectNO, (Convert.ToUInt32(_ViewInfo.DocumentItemID) / 100).ToString(), _ViewInfo.DocumentItemID, "{PageNo}");
227 222
            _DocInfo = e.Result;
228 223
            _DocInfo.ORIGINAL_FILE = HttpUtility.UrlDecode(_DocInfo.ORIGINAL_FILE);
229 224
            foreach (var item in _DocInfo.DOCPAGE.OrderBy(order => order.PAGE_NUMBER))
MarkupToPDF/Common/GetUserSign.cs
4 4
using System.Collections.Generic;
5 5
using System.IO;
6 6
using System.Linq;
7
using System.Net;
7 8
using System.Runtime.InteropServices;
8 9
using System.ServiceModel;
9 10
using System.Text;
......
45 46
            _binding.CloseTimeout = new TimeSpan(0, 5, 0);
46 47
            _binding.SendTimeout = new TimeSpan(0, 5, 0);
47 48
            _binding.TextEncoding = System.Text.Encoding.UTF8;
48
            _binding.TransferMode = TransferMode.Buffered;            
49
            _binding.TransferMode = TransferMode.Buffered;
49 50

  
50
            string sBaseServiceURL = CommonLib.Common.GetConfigString("BaseClientAddress", "URL", "");
51
            string localdomain = CommonLib.Common.GetConfigString("HOST_DOMAIN", "DOMAIN", "");
52
            var ipaddress = CommonLib.DNSHelper.GetDnsAdress();
53
            bool isExternal = false;
54
            try
55
            {
56
                var hostName = Dns.GetHostEntry(ipaddress).HostName;
57

  
58
                if (!hostName.EndsWith(localdomain))
59
                {
60
                    // 외부 사용자
61
                    isExternal = true;
62
                }
63
            }
64
            catch (Exception ex)
65
            {
66
                System.Diagnostics.Debug.WriteLine(ex.ToString());
67
            }
68
            string sBaseServiceURL = CommonLib.Common.GetConfigString("BaseClientAddress", "URL", "", isExternal);
69
            //CommonLib.Common.GetConfigString("BaseClientAddress", "URL", "");
51 70

  
52 71
            _EndPoint = new EndpointAddress(string.Format("{0}/ServiceDeepView.svc", sBaseServiceURL));
53 72

  

내보내기 Unified diff

클립보드 이미지 추가 (최대 크기: 500 MB)