<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; VBScript: определение текущего IP-адреса]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=692&amp;type=atom" />
	<updated>2007-12-25T19:25:26Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=692</id>
		<entry>
			<title type="html"><![CDATA[Re: VBScript: определение текущего IP-адреса]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=7357#p7357" />
			<content type="html"><![CDATA[<p>Получение IP-адреса для определённого сетевого подключения:<br /></p><div class="codebox"><pre><code>strComputer  =  &quot;.&quot;
&#039; отредактировать под нужное имя сетевого подключения:
strNetworkConnection = &quot;&#039;Подключение по локальной сети&#039;&quot;

Set objWMIService = GetObject(&quot;winmgmts:\\&quot; &amp; strComputer &amp; &quot;\root\cimv2&quot;)
Set colNics = objWMIService.ExecQuery(&quot;Select * From Win32_NetworkAdapter &quot; _
    &amp; &quot;Where NetConnectionID = &quot; &amp; strNetworkConnection)
For Each objNic in colNics
    Set colNicConfigs = objWMIService.ExecQuery(&quot;ASSOCIATORS OF &quot; _
        &amp; &quot;{Win32_NetworkAdapter.DeviceID=&#039;&quot; &amp; objNic.DeviceID &amp; &quot;&#039;}&quot; _
        &amp; &quot; WHERE AssocClass=Win32_NetworkAdapterSetting&quot;)
    For Each objNicConfig In colNicConfigs
        For Each strIPAddress in objNicConfig.IPAddress
            Wscript.Echo &quot;IP Address: &quot; &amp; strIPAddress
        Next
    Next
Next</code></pre></div><p>Пример опубликовал <strong>cmepx</strong>.</p>]]></content>
			<author>
				<name><![CDATA[The gray Cardinal]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=2</uri>
			</author>
			<updated>2007-12-25T19:25:26Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=7357#p7357</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[VBScript: определение текущего IP-адреса]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=4845#p4845" />
			<content type="html"><![CDATA[<p>Определение текущих IP-адресов существующих сетевых подключений данного компьютера.<br /></p><div class="codebox"><pre><code>strComputer = &quot;.&quot;
Set objWMIService = GetObject(&quot;winmgmts:&quot; _
    &amp; &quot;{impersonationLevel=impersonate}!\\&quot; &amp; strComputer &amp; &quot;\root\cimv2&quot;)

Set IPConfigSet = objWMIService.ExecQuery _
    (&quot;Select * from Win32_NetworkAdapterConfiguration Where IPEnabled=TRUE&quot;)
 
For Each IPConfig in IPConfigSet
    If Not IsNull(IPConfig.IPAddress) Then 
        For Each IPAddress In IPConfig.IPAddress
            WScript.Echo IPAddress
        Next
    End If
Next</code></pre></div>]]></content>
			<author>
				<name><![CDATA[The gray Cardinal]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=2</uri>
			</author>
			<updated>2007-09-17T16:56:14Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=4845#p4845</id>
		</entry>
</feed>
