<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; VBS: WMI аналог "netstat -ano"]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=10619&amp;type=atom" />
	<updated>2015-05-01T11:14:25Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=10619</id>
		<entry>
			<title type="html"><![CDATA[Re: VBS: WMI аналог "netstat -ano"]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=93770#p93770" />
			<content type="html"><![CDATA[<p>Не, ну как бы да, конечно...<br />Окошко уберётся...<br />Подумаю, может изменю времянку.<br />Спасибо.<br />Но изначальный вопрос остаётся открытым.</p>]]></content>
			<author>
				<name><![CDATA[MikeSh]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24507</uri>
			</author>
			<updated>2015-05-01T11:14:25Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=93770#p93770</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBS: WMI аналог "netstat -ano"]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=93769#p93769" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>MikeSh пишет:</cite><blockquote><p>В этой реализации смущает чёрное окно командной строки, появляющееся на мгновение.</p></blockquote></div><p><a href="http://forum.script-coding.com/viewtopic.php?pid=89488#p89488">Пример обхода</a>.</p>]]></content>
			<author>
				<name><![CDATA[Flasher]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27593</uri>
			</author>
			<updated>2015-05-01T11:11:16Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=93769#p93769</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[VBS: WMI аналог "netstat -ano"]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=93768#p93768" />
			<content type="html"><![CDATA[<p>Добрый день.<br />Искал в интернетах и зашёл в тупик.<br />Изначальная задача - найти IP сервера, зная, PID процесса, который к нему подключен.</p><p>В данный момент это реализовано таким образом</p><div class="codebox"><pre><code>
Function GetFBDServerIP(Pid)

  fIP = &quot;&quot;

  Set shExec = WshShell.Exec(&quot;cmd /c netstat -ano|Find &quot;&quot;:3050&quot;&quot;|Find &quot;&quot;&quot; &amp; Pid &amp; &quot;&quot;&quot;&quot;)

  While (Not shExec.StdOut.AtEndOfStream) And fIP = &quot;&quot;

    Str = shExec.StdOut.ReadLine()
    If Right(Str, Len(Pid)) = Pid &amp; &quot;&quot; Then
      SplitStr = Split(Str, &quot; &quot;)
      i = 0 

      While i &lt; UBound(SplitStr) And fIP = &quot;&quot;

        If InStr(SplitStr(i), &quot;:3050&quot;) &lt;&gt; 0 Then fIP = Replace(SplitStr(i), &quot;:3050&quot;, &quot;&quot;)
        i = i + 1

      WEnd

    End If

  WEnd

  GetFBDServerIP = fIP

End Function
</code></pre></div><p>Прошу не судить за код строго, я считаю его времянкой, пока не найду более удачного решения.<br />В этой реализации смущает чёрное окно командной строки, появляющееся на мгновение.</p>]]></content>
			<author>
				<name><![CDATA[MikeSh]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24507</uri>
			</author>
			<updated>2015-05-01T10:59:03Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=93768#p93768</id>
		</entry>
</feed>
