private string GetIP() {     
string strHostName = "";     
strHostName = System.Net.Dns.GetHostName();    
IPHostEntry ipEntry = System.Net.Dns.GetHostEntry(strHostName);    
IPAddress[] addr = ipEntry.AddressList;     
return addr[addr.Length - 1].ToString(); 
}

C# 에서 IP 주소 가져오는 방법

 

'기타 ETC > C#' 카테고리의 다른 글

UI 쓰레드 에러 문제 해결하기  (0) 2020.04.09
C# 리스트박스 항목 가져오기  (0) 2020.04.09
c# 둥근 버튼 만들기  (0) 2020.03.24
C# 그라디언트 판넬 컨트롤 만들기  (0) 2020.03.24
C# DragControl 만들기  (0) 2020.03.24

+ Recent posts