{"id":397,"date":"2012-08-21T12:24:39","date_gmt":"2012-08-21T03:24:39","guid":{"rendered":"http:\/\/auctionpro.co.kr\/WPress\/?p=397"},"modified":"2023-01-18T12:03:14","modified_gmt":"2023-01-18T03:03:14","slug":"ip-%ec%a3%bc%ec%86%8c-%ea%b0%80%ec%a0%b8-%ec%98%a4%ea%b8%b0-%ed%95%a8%ec%88%98","status":"publish","type":"post","link":"https:\/\/www.auctionpro.co.kr\/?p=397","title":{"rendered":"vb6\uc5d0\uc11c  IP \uc8fc\uc18c \uac00\uc838 \uc624\uae30 \ud568\uc218"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">\ucc38\uc870 : <a href=\"https:\/\/learn.microsoft.com\/en-us\/windows\/win32\/api\/iphlpapi\/nf-iphlpapi-getipaddrtable\">https:\/\/learn.microsoft.com\/en-us\/windows\/win32\/api\/iphlpapi\/nf-iphlpapi-getipaddrtable<\/a><\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:asp decode:true \" title=\"VB6\" >Private Declare Function GetIpAddrTable_API Lib \"IpHlpApi\" Alias \"GetIpAddrTable\" (pIPAddrTable As Any, pdwSize As Long, ByVal bOrder As Long) As Long\n \n'IP \uc8fc\uc18c \uac00\uc838 \uc624\uae30\n' Returns an array with the local IP addresses (as strings).\n' Author: Christian d'Heureuse, www.source-code.biz\nPublic Function GetIpAddrTable() As String\n    On Error Resume Next\n\tDim Buf(0 To 511) As Byte\n\tDim BufSize As Long: BufSize = UBound(Buf) + 1\n\tDim rc As Long\n\t\n\trc = GetIpAddrTable_API(Buf(0), BufSize, 1)\n\t\n\tIf rc &lt;&gt; 0 Then Err.Raise vbObjectError, , \"GetIpAddrTable failed with return value \" &amp; rc\n\tDim NrOfEntries As Integer: NrOfEntries = Buf(1) * 256 + Buf(0)\n\t\n\tIf NrOfEntries = 0 Then GetIpAddrTable = Array(): Exit Function\n\tReDim IpAddrs(0 To NrOfEntries - 1) As String\n\t\n\tDim i As Integer\n\t\n\tFor i = 0 To NrOfEntries - 1\n\tDim j As Integer, s As String: s = \"\"\n\t    For j = 0 To 3: s = s &amp; IIf(j &gt; 0, \".\", \"\") &amp; Buf(4 + i * 24 + j): Next\n\tIpAddrs(i) = s\n\tNext\n\t\n\tGetIpAddrTable = IpAddrs(UBound(IpAddrs))\nEnd Function<\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">c++ \uc5d0\uc11c <\/h2>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:c++ decode:true \" title=\"C++\" >#include &lt;winsock2.h&gt;\n#include &lt;ws2tcpip.h&gt;\n#include &lt;iphlpapi.h&gt;\n#include &lt;stdio.h&gt;\n\n#pragma comment(lib, \"iphlpapi.lib\")\n#pragma comment(lib, \"ws2_32.lib\")\n\n#define MALLOC(x) HeapAlloc(GetProcessHeap(), 0, (x))\n#define FREE(x) HeapFree(GetProcessHeap(), 0, (x))\n\n\/* Note: could also use malloc() and free() *\/\n\nint __cdecl main()\n{\n\n    int i;\n    \n    \/* Variables used by GetIpAddrTable *\/\n    PMIB_IPADDRTABLE pIPAddrTable;\n    DWORD dwSize = 0;\n    DWORD dwRetVal = 0;\n    IN_ADDR IPAddr;\n\n    \/* Variables used to return error message *\/\n    LPVOID lpMsgBuf;\n\n    \/\/ Before calling AddIPAddress we use GetIpAddrTable to get\n    \/\/ an adapter to which we can add the IP.\n    pIPAddrTable = (MIB_IPADDRTABLE *) MALLOC(sizeof (MIB_IPADDRTABLE));\n\n    if (pIPAddrTable) {\n        \/\/ Make an initial call to GetIpAddrTable to get the\n        \/\/ necessary size into the dwSize variable\n        if (GetIpAddrTable(pIPAddrTable, &amp;dwSize, 0) ==\n            ERROR_INSUFFICIENT_BUFFER) {\n            FREE(pIPAddrTable);\n            pIPAddrTable = (MIB_IPADDRTABLE *) MALLOC(dwSize);\n\n        }\n        if (pIPAddrTable == NULL) {\n            printf(\"Memory allocation failed for GetIpAddrTable\\n\");\n            exit(1);\n        }\n    }\n    \/\/ Make a second call to GetIpAddrTable to get the\n    \/\/ actual data we want\n    if ( (dwRetVal = GetIpAddrTable( pIPAddrTable, &amp;dwSize, 0 )) != NO_ERROR ) { \n        printf(\"GetIpAddrTable failed with error %d\\n\", dwRetVal);\n        if (FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, dwRetVal, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),       \/\/ Default language\n                          (LPTSTR) &amp; lpMsgBuf, 0, NULL)) {\n            printf(\"\\tError: %s\", lpMsgBuf);\n            LocalFree(lpMsgBuf);\n        }\n        exit(1);\n    }\n\n    printf(\"\\tNum Entries: %ld\\n\", pIPAddrTable-&gt;dwNumEntries);\n    for (i=0; i &lt; (int) pIPAddrTable-&gt;dwNumEntries; i++) {\n        printf(\"\\n\\tInterface Index[%d]:\\t%ld\\n\", i, pIPAddrTable-&gt;table[i].dwIndex);\n        IPAddr.S_un.S_addr = (u_long) pIPAddrTable-&gt;table[i].dwAddr;\n        printf(\"\\tIP Address[%d]:     \\t%s\\n\", i, inet_ntoa(IPAddr) );\n        IPAddr.S_un.S_addr = (u_long) pIPAddrTable-&gt;table[i].dwMask;\n        printf(\"\\tSubnet Mask[%d]:    \\t%s\\n\", i, inet_ntoa(IPAddr) );\n        IPAddr.S_un.S_addr = (u_long) pIPAddrTable-&gt;table[i].dwBCastAddr;\n        printf(\"\\tBroadCast[%d]:      \\t%s (%ld%)\\n\", i, inet_ntoa(IPAddr), pIPAddrTable-&gt;table[i].dwBCastAddr);\n        printf(\"\\tReassembly size[%d]:\\t%ld\\n\", i, pIPAddrTable-&gt;table[i].dwReasmSize);\n        printf(\"\\tType and State[%d]:\", i);\n        if (pIPAddrTable-&gt;table[i].wType &amp; MIB_IPADDR_PRIMARY)\n            printf(\"\\tPrimary IP Address\");\n        if (pIPAddrTable-&gt;table[i].wType &amp; MIB_IPADDR_DYNAMIC)\n            printf(\"\\tDynamic IP Address\");\n        if (pIPAddrTable-&gt;table[i].wType &amp; MIB_IPADDR_DISCONNECTED)\n            printf(\"\\tAddress is on disconnected interface\");\n        if (pIPAddrTable-&gt;table[i].wType &amp; MIB_IPADDR_DELETED)\n            printf(\"\\tAddress is being deleted\");\n        if (pIPAddrTable-&gt;table[i].wType &amp; MIB_IPADDR_TRANSIENT)\n            printf(\"\\tTransient address\");\n        printf(\"\\n\");\n    }\n\n    if (pIPAddrTable) {\n        FREE(pIPAddrTable);\n        pIPAddrTable = NULL;\n    }\n\n    exit(0);\n}\n<\/pre><\/div>\n","protected":false},"excerpt":{"rendered":"<div class=\"mh-excerpt\"><p>\ucc38\uc870 : https:\/\/learn.microsoft.com\/en-us\/windows\/win32\/api\/iphlpapi\/nf-iphlpapi-getipaddrtable c++ \uc5d0\uc11c<\/p>\n<\/div>","protected":false},"author":6,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[14],"tags":[],"class_list":["post-397","post","type-post","status-publish","format-standard","hentry","category-visualbasic6-0-vb"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.7 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>vb6\uc5d0\uc11c IP \uc8fc\uc18c \uac00\uc838 \uc624\uae30 \ud568\uc218 - AuctionPro<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.auctionpro.co.kr\/?p=397\" \/>\n<meta property=\"og:locale\" content=\"ko_KR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"vb6\uc5d0\uc11c IP \uc8fc\uc18c \uac00\uc838 \uc624\uae30 \ud568\uc218 - AuctionPro\" \/>\n<meta property=\"og:description\" content=\"\ucc38\uc870 : https:\/\/learn.microsoft.com\/en-us\/windows\/win32\/api\/iphlpapi\/nf-iphlpapi-getipaddrtable c++ \uc5d0\uc11c\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.auctionpro.co.kr\/?p=397\" \/>\n<meta property=\"og:site_name\" content=\"AuctionPro\" \/>\n<meta property=\"article:published_time\" content=\"2012-08-21T03:24:39+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-01-18T03:03:14+00:00\" \/>\n<meta name=\"author\" content=\"golgol\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\uae00\uc4f4\uc774\" \/>\n\t<meta name=\"twitter:data1\" content=\"golgol\" \/>\n\t<meta name=\"twitter:label2\" content=\"\uc608\uc0c1 \ub418\ub294 \ud310\ub3c5 \uc2dc\uac04\" \/>\n\t<meta name=\"twitter:data2\" content=\"3\ubd84\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.auctionpro.co.kr\\\/?p=397#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.auctionpro.co.kr\\\/?p=397\"},\"author\":{\"name\":\"golgol\",\"@id\":\"https:\\\/\\\/www.auctionpro.co.kr\\\/#\\\/schema\\\/person\\\/d3dbae599b06cd55f5b14a3e2116f7a2\"},\"headline\":\"vb6\uc5d0\uc11c IP \uc8fc\uc18c \uac00\uc838 \uc624\uae30 \ud568\uc218\",\"datePublished\":\"2012-08-21T03:24:39+00:00\",\"dateModified\":\"2023-01-18T03:03:14+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.auctionpro.co.kr\\\/?p=397\"},\"wordCount\":13,\"commentCount\":0,\"articleSection\":[\"[Dev]VB6.0\"],\"inLanguage\":\"ko-KR\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.auctionpro.co.kr\\\/?p=397#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.auctionpro.co.kr\\\/?p=397\",\"url\":\"https:\\\/\\\/www.auctionpro.co.kr\\\/?p=397\",\"name\":\"vb6\uc5d0\uc11c IP \uc8fc\uc18c \uac00\uc838 \uc624\uae30 \ud568\uc218 - AuctionPro\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.auctionpro.co.kr\\\/#website\"},\"datePublished\":\"2012-08-21T03:24:39+00:00\",\"dateModified\":\"2023-01-18T03:03:14+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.auctionpro.co.kr\\\/#\\\/schema\\\/person\\\/d3dbae599b06cd55f5b14a3e2116f7a2\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.auctionpro.co.kr\\\/?p=397#breadcrumb\"},\"inLanguage\":\"ko-KR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.auctionpro.co.kr\\\/?p=397\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.auctionpro.co.kr\\\/?p=397#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\ud648\",\"item\":\"https:\\\/\\\/www.auctionpro.co.kr\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"vb6\uc5d0\uc11c IP \uc8fc\uc18c \uac00\uc838 \uc624\uae30 \ud568\uc218\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.auctionpro.co.kr\\\/#website\",\"url\":\"https:\\\/\\\/www.auctionpro.co.kr\\\/\",\"name\":\"AuctionPro\",\"description\":\"\uc625\uc158\ud504\ub85c\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.auctionpro.co.kr\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"ko-KR\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.auctionpro.co.kr\\\/#\\\/schema\\\/person\\\/d3dbae599b06cd55f5b14a3e2116f7a2\",\"name\":\"golgol\",\"url\":\"https:\\\/\\\/www.auctionpro.co.kr\\\/?author=6\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"vb6\uc5d0\uc11c IP \uc8fc\uc18c \uac00\uc838 \uc624\uae30 \ud568\uc218 - AuctionPro","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.auctionpro.co.kr\/?p=397","og_locale":"ko_KR","og_type":"article","og_title":"vb6\uc5d0\uc11c IP \uc8fc\uc18c \uac00\uc838 \uc624\uae30 \ud568\uc218 - AuctionPro","og_description":"\ucc38\uc870 : https:\/\/learn.microsoft.com\/en-us\/windows\/win32\/api\/iphlpapi\/nf-iphlpapi-getipaddrtable c++ \uc5d0\uc11c","og_url":"https:\/\/www.auctionpro.co.kr\/?p=397","og_site_name":"AuctionPro","article_published_time":"2012-08-21T03:24:39+00:00","article_modified_time":"2023-01-18T03:03:14+00:00","author":"golgol","twitter_card":"summary_large_image","twitter_misc":{"\uae00\uc4f4\uc774":"golgol","\uc608\uc0c1 \ub418\ub294 \ud310\ub3c5 \uc2dc\uac04":"3\ubd84"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.auctionpro.co.kr\/?p=397#article","isPartOf":{"@id":"https:\/\/www.auctionpro.co.kr\/?p=397"},"author":{"name":"golgol","@id":"https:\/\/www.auctionpro.co.kr\/#\/schema\/person\/d3dbae599b06cd55f5b14a3e2116f7a2"},"headline":"vb6\uc5d0\uc11c IP \uc8fc\uc18c \uac00\uc838 \uc624\uae30 \ud568\uc218","datePublished":"2012-08-21T03:24:39+00:00","dateModified":"2023-01-18T03:03:14+00:00","mainEntityOfPage":{"@id":"https:\/\/www.auctionpro.co.kr\/?p=397"},"wordCount":13,"commentCount":0,"articleSection":["[Dev]VB6.0"],"inLanguage":"ko-KR","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.auctionpro.co.kr\/?p=397#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.auctionpro.co.kr\/?p=397","url":"https:\/\/www.auctionpro.co.kr\/?p=397","name":"vb6\uc5d0\uc11c IP \uc8fc\uc18c \uac00\uc838 \uc624\uae30 \ud568\uc218 - AuctionPro","isPartOf":{"@id":"https:\/\/www.auctionpro.co.kr\/#website"},"datePublished":"2012-08-21T03:24:39+00:00","dateModified":"2023-01-18T03:03:14+00:00","author":{"@id":"https:\/\/www.auctionpro.co.kr\/#\/schema\/person\/d3dbae599b06cd55f5b14a3e2116f7a2"},"breadcrumb":{"@id":"https:\/\/www.auctionpro.co.kr\/?p=397#breadcrumb"},"inLanguage":"ko-KR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.auctionpro.co.kr\/?p=397"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.auctionpro.co.kr\/?p=397#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\ud648","item":"https:\/\/www.auctionpro.co.kr\/"},{"@type":"ListItem","position":2,"name":"vb6\uc5d0\uc11c IP \uc8fc\uc18c \uac00\uc838 \uc624\uae30 \ud568\uc218"}]},{"@type":"WebSite","@id":"https:\/\/www.auctionpro.co.kr\/#website","url":"https:\/\/www.auctionpro.co.kr\/","name":"AuctionPro","description":"\uc625\uc158\ud504\ub85c","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.auctionpro.co.kr\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"ko-KR"},{"@type":"Person","@id":"https:\/\/www.auctionpro.co.kr\/#\/schema\/person\/d3dbae599b06cd55f5b14a3e2116f7a2","name":"golgol","url":"https:\/\/www.auctionpro.co.kr\/?author=6"}]}},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/397","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=397"}],"version-history":[{"count":0,"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/397\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=397"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=397"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=397"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}