<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
	<channel>
		<title>Mikrotik.moscow [тема: VB .net: общение через IP-адрес роутера]</title>
		<link>http://mikrotik.moscow</link>
		<description>Новое в теме VB .net: общение через IP-адрес роутера форума RouterOS на сайте Mikrotik.moscow [mikrotik.moscow]</description>
		<language>ru</language>
		<docs>http://backend.userland.com/rss2</docs>
		<pubDate>Thu, 20 Aug 2026 07:57:55 -0400</pubDate>
		<item>
			<title>VB .net: общение через IP-адрес роутера</title>
			<description><![CDATA[<b><a href="http://mikrotik.moscow/forum/forum57/59430-vb-.net_-obshchenie-cherez-ip_adres-routera/message225839">VB .net: общение через IP-адрес роутера</a></b> <i>RouterOS</i> в форуме <a href="http://mikrotik.moscow/forum/forum57/">RouterOS</a>. <br />
			Зацени эту коммуникацию по TCP/IP: <noindex><a href="http://vb.net-informations.com/communications/vb.net_socket_programming.htm" target="_blank" rel="nofollow" >http://vb.net-informations.com/communications/vb.net_socket_programming.htm</a></noindex>. Подключайся и передавай потоки, wills. <br />
			<i>09.09.2012 19:14:00, willsmannar.</i>]]></description>
			<link>http://mikrotik.moscow/forum/forum57/59430-vb-.net_-obshchenie-cherez-ip_adres-routera/message225839</link>
			<guid>http://mikrotik.moscow/forum/forum57/59430-vb-.net_-obshchenie-cherez-ip_adres-routera/message225839</guid>
			<pubDate>Sun, 09 Sep 2012 19:14:00 -0400</pubDate>
			<category>RouterOS</category>
		</item>
		<item>
			<title>VB .net: общение через IP-адрес роутера</title>
			<description><![CDATA[<b><a href="http://mikrotik.moscow/forum/forum57/59430-vb-.net_-obshchenie-cherez-ip_adres-routera/message225838">VB .net: общение через IP-адрес роутера</a></b> <i>RouterOS</i> в форуме <a href="http://mikrotik.moscow/forum/forum57/">RouterOS</a>. <br />
			Привет, Гжегож! Большое спасибо за правки. Это именно то, что мне было нужно. Пранав. <br />
			<i>20.08.2012 13:41:00, slimprize.</i>]]></description>
			<link>http://mikrotik.moscow/forum/forum57/59430-vb-.net_-obshchenie-cherez-ip_adres-routera/message225838</link>
			<guid>http://mikrotik.moscow/forum/forum57/59430-vb-.net_-obshchenie-cherez-ip_adres-routera/message225838</guid>
			<pubDate>Mon, 20 Aug 2012 13:41:00 -0400</pubDate>
			<category>RouterOS</category>
		</item>
		<item>
			<title>VB .net: общение через IP-адрес роутера</title>
			<description><![CDATA[<b><a href="http://mikrotik.moscow/forum/forum57/59430-vb-.net_-obshchenie-cherez-ip_adres-routera/message225837">VB .net: общение через IP-адрес роутера</a></b> <i>RouterOS</i> в форуме <a href="http://mikrotik.moscow/forum/forum57/">RouterOS</a>. <br />
			Вот мои небольшие изменения кода: Sub Main()<br /> &nbsp; &nbsp; &nbsp; &nbsp;Dim IPAddress As System.Net.IPAddress = System.Net.IPAddress.Parse("192.168.88.1")<br /><br /> &nbsp; &nbsp; &nbsp; &nbsp;Dim mk = New Mikrotik(IPAddress)<br /><br /> &nbsp; &nbsp; &nbsp; &nbsp;If Not mk.Login("user", "pass") Then<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Console.WriteLine("Не могу войти")<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;mk.Close()<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Console.ReadLine()<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Return<br /> &nbsp; &nbsp; &nbsp; &nbsp;End If<br /><br /> &nbsp; &nbsp; &nbsp; &nbsp;mk.Send("/system/clock/getall", True)<br /> &nbsp; &nbsp; &nbsp; &nbsp;For Each row In mk.Read()<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Console.WriteLine(row)<br /> &nbsp; &nbsp; &nbsp; &nbsp;Next<br /> &nbsp; &nbsp; &nbsp; &nbsp;Console.ReadLine()<br /> &nbsp; &nbsp;End Sub Public Sub New(ByVal IPAddr As System.Net.IPAddress, Optional ByVal port As Integer = -1)<br /><br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;tcpCon.Connect(IPAddr, If(port = -1, 8728, port))<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;tcpStream = tcpCon.GetStream()<br /> &nbsp; &nbsp; &nbsp; &nbsp;End Sub Теперь этот пример работает без DNS. Надеюсь, это поможет, <br />
			<i>20.08.2012 13:14:00, ditonet.</i>]]></description>
			<link>http://mikrotik.moscow/forum/forum57/59430-vb-.net_-obshchenie-cherez-ip_adres-routera/message225837</link>
			<guid>http://mikrotik.moscow/forum/forum57/59430-vb-.net_-obshchenie-cherez-ip_adres-routera/message225837</guid>
			<pubDate>Mon, 20 Aug 2012 13:14:00 -0400</pubDate>
			<category>RouterOS</category>
		</item>
		<item>
			<title>VB .net: общение через IP-адрес роутера</title>
			<description><![CDATA[<b><a href="http://mikrotik.moscow/forum/forum57/59430-vb-.net_-obshchenie-cherez-ip_adres-routera/message225836">VB .net: общение через IP-адрес роутера</a></b> <i>RouterOS</i> в форуме <a href="http://mikrotik.moscow/forum/forum57/">RouterOS</a>. <br />
			Привет, я провёл трассировку. Проблема в tcpCon.Connect(ips.AddressList(0), If(port = -1, 8728, port)). Что мне непонятно, так это что делает следующая строка: Dim ips = Net.Dns.GetHostEntry(ipOrDns). Насколько я понимаю, эта строка запрашивает DNS-сервер, которого у меня нет. У меня есть только один IP-адрес, к которому я хочу подключить поток. Пранав. <br />
			<i>20.08.2012 12:30:00, slimprize.</i>]]></description>
			<link>http://mikrotik.moscow/forum/forum57/59430-vb-.net_-obshchenie-cherez-ip_adres-routera/message225836</link>
			<guid>http://mikrotik.moscow/forum/forum57/59430-vb-.net_-obshchenie-cherez-ip_adres-routera/message225836</guid>
			<pubDate>Mon, 20 Aug 2012 12:30:00 -0400</pubDate>
			<category>RouterOS</category>
		</item>
		<item>
			<title>VB .net: общение через IP-адрес роутера</title>
			<description><![CDATA[<b><a href="http://mikrotik.moscow/forum/forum57/59430-vb-.net_-obshchenie-cherez-ip_adres-routera/message225835">VB .net: общение через IP-адрес роутера</a></b> <i>RouterOS</i> в форуме <a href="http://mikrotik.moscow/forum/forum57/">RouterOS</a>. <br />
			Используй встроенный отладчик Visual Studio, чтобы найти источник ошибки. Запускай свой проект клавишей F8 – он будет выполнять твой код построчно. Удачи, HTH. <br />
			<i>20.08.2012 12:00:00, ditonet.</i>]]></description>
			<link>http://mikrotik.moscow/forum/forum57/59430-vb-.net_-obshchenie-cherez-ip_adres-routera/message225835</link>
			<guid>http://mikrotik.moscow/forum/forum57/59430-vb-.net_-obshchenie-cherez-ip_adres-routera/message225835</guid>
			<pubDate>Mon, 20 Aug 2012 12:00:00 -0400</pubDate>
			<category>RouterOS</category>
		</item>
		<item>
			<title>VB .net: общение через IP-адрес роутера</title>
			<description><![CDATA[<b><a href="http://mikrotik.moscow/forum/forum57/59430-vb-.net_-obshchenie-cherez-ip_adres-routera/message225834">VB .net: общение через IP-адрес роутера</a></b> <i>RouterOS</i> в форуме <a href="http://mikrotik.moscow/forum/forum57/">RouterOS</a>. <br />
			[admin@conShield] /ip service&gt; print<br />Flags: X - disabled, I - invalid<br />NAME &nbsp; &nbsp; &nbsp; &nbsp;PORT ADDRESS &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CERTIFICATE<br />0 &nbsp; telnet &nbsp; &nbsp; &nbsp; &nbsp;23<br />1 &nbsp; ftp &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 21<br />2 &nbsp; www &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 80<br />3 &nbsp; ssh &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 22<br />4 X www-ssl &nbsp; &nbsp; &nbsp;443 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; none<br />5 &nbsp; api &nbsp; &nbsp; &nbsp; &nbsp; 8728<br />6 &nbsp; winbox &nbsp; &nbsp; &nbsp;8291<br /><br />I removed the ip address conversion function and now, I am getting an index out of range exception. An unhandled exception of type ‘System.IndexOutOfRangeException’ occurred in RBCmd.exe<br />Additional information: Index was outside the bounds of the array. The error is at tcpCon.Connect(ips.AddressList(0), If(port = -1, 8728, port))<br /><br />my modified code is<br />Sub Main()<br />Dim mk = New Mikrotik(“192.168.88.1”)<br />If Not mk.Login(“admin”, “pwd”) Then<br />Console.WriteLine(“Cant log in”)<br />mk.Close()<br />Console.ReadLine()<br />Return<br />End If<br />mk.Send(“/system/clock/getall”, True)<br />For Each row In mk.Read()<br />Console.WriteLine(row)<br />Next<br />Console.ReadLine()<br />End Sub <br />
			<i>18.08.2012 23:54:00, slimprize.</i>]]></description>
			<link>http://mikrotik.moscow/forum/forum57/59430-vb-.net_-obshchenie-cherez-ip_adres-routera/message225834</link>
			<guid>http://mikrotik.moscow/forum/forum57/59430-vb-.net_-obshchenie-cherez-ip_adres-routera/message225834</guid>
			<pubDate>Sat, 18 Aug 2012 23:54:00 -0400</pubDate>
			<category>RouterOS</category>
		</item>
		<item>
			<title>VB .net: общение через IP-адрес роутера</title>
			<description><![CDATA[<b><a href="http://mikrotik.moscow/forum/forum57/59430-vb-.net_-obshchenie-cherez-ip_adres-routera/message225833">VB .net: общение через IP-адрес роутера</a></b> <i>RouterOS</i> в форуме <a href="http://mikrotik.moscow/forum/forum57/">RouterOS</a>. <br />
			Winbox работает. API – это отдельный сервис и работает на порту 8728 (по умолчанию). Проверьте это в ‘IP/Services’. В вашем коде IP-адрес (в виде строки) преобразуется в целое число. Public Sub New(ByVal ipOrDns As String, Optional ByVal port As Integer = -1) Dim ips = Net.Dns.GetHostEntry(ipOrDns) tcpCon.Connect(ips.AddressList(0), If(port = -1, 8728, port)) tcpStream = tcpCon.GetStream() End Sub Sub New в классе Mikrotik требует ipOrDns As String. Также есть ошибка в ‘Function IPToInteger’: IP-адрес преобразуется в обратном порядке, например, 1.88.168.192. Надеюсь, это поможет, HTH. <br />
			<i>18.08.2012 22:03:00, ditonet.</i>]]></description>
			<link>http://mikrotik.moscow/forum/forum57/59430-vb-.net_-obshchenie-cherez-ip_adres-routera/message225833</link>
			<guid>http://mikrotik.moscow/forum/forum57/59430-vb-.net_-obshchenie-cherez-ip_adres-routera/message225833</guid>
			<pubDate>Sat, 18 Aug 2012 22:03:00 -0400</pubDate>
			<category>RouterOS</category>
		</item>
		<item>
			<title>VB .net: общение через IP-адрес роутера</title>
			<description><![CDATA[<b><a href="http://mikrotik.moscow/forum/forum57/59430-vb-.net_-obshchenie-cherez-ip_adres-routera/message225832">VB .net: общение через IP-адрес роутера</a></b> <i>RouterOS</i> в форуме <a href="http://mikrotik.moscow/forum/forum57/">RouterOS</a>. <br />
			Winbox работает. Подозриваю, что проблема в моем .net коде. У меня нет DNS-сервера в локальной сети. Это домашняя сеть, поэтому я изменил код, чтобы он обрабатывал один IP-адрес. Какие еще есть мысли? <br />
			<i>18.08.2012 00:08:00, slimprize.</i>]]></description>
			<link>http://mikrotik.moscow/forum/forum57/59430-vb-.net_-obshchenie-cherez-ip_adres-routera/message225832</link>
			<guid>http://mikrotik.moscow/forum/forum57/59430-vb-.net_-obshchenie-cherez-ip_adres-routera/message225832</guid>
			<pubDate>Sat, 18 Aug 2012 00:08:00 -0400</pubDate>
			<category>RouterOS</category>
		</item>
		<item>
			<title>VB .net: общение через IP-адрес роутера</title>
			<description><![CDATA[<b><a href="http://mikrotik.moscow/forum/forum57/59430-vb-.net_-obshchenie-cherez-ip_adres-routera/message225831">VB .net: общение через IP-адрес роутера</a></b> <i>RouterOS</i> в форуме <a href="http://mikrotik.moscow/forum/forum57/">RouterOS</a>. <br />
			Начнём с главного: проверьте, включен ли порт API-сервиса и не заблокирован ли он брандмауэром. Также проверьте, доступен ли ваш роутер с вашего ПК. После этого можно проверить с помощью Python-клиента, всё ли в порядке. А потом можно начинать проверять с какого-нибудь неизвестного клиента, чтобы попробовать подключиться, аутентифицироваться и выполнить некоторые запросы. <br />
			<i>17.08.2012 12:51:00, janisk.</i>]]></description>
			<link>http://mikrotik.moscow/forum/forum57/59430-vb-.net_-obshchenie-cherez-ip_adres-routera/message225831</link>
			<guid>http://mikrotik.moscow/forum/forum57/59430-vb-.net_-obshchenie-cherez-ip_adres-routera/message225831</guid>
			<pubDate>Fri, 17 Aug 2012 12:51:00 -0400</pubDate>
			<category>RouterOS</category>
		</item>
		<item>
			<title>VB .net: общение через IP-адрес роутера</title>
			<description><![CDATA[<b><a href="http://mikrotik.moscow/forum/forum57/59430-vb-.net_-obshchenie-cherez-ip_adres-routera/message225830">VB .net: общение через IP-адрес роутера</a></b> <i>RouterOS</i> в форуме <a href="http://mikrotik.moscow/forum/forum57/">RouterOS</a>. <br />
			Привет всем!<br /><br />Я пытаюсь использовать пример из вики в простом приложении на vb.net. Не получается связаться с роутером. Выдаёт ошибку "host not found". Мой код ниже.<br /><br />```<br />Module Module1<br /> &nbsp; &nbsp;'function from <noindex><a href="http://www.planet-source-code.com/vb/scripts/ShowCodeAsText.asp?txtCodeId=5179&amp;lngWId=10" target="_blank" rel="nofollow" >http://www.planet-source-code.com/vb/scripts/ShowCodeAsText.asp?txtCodeId=5179&amp;lngWId=10</a></noindex><br /> &nbsp; &nbsp;Private Function IPToInteger(ByVal Expression As String) As Integer<br /> &nbsp; &nbsp; &nbsp; &nbsp;Try<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Dim IPAddress As System.Net.IPAddress = System.Net.IPAddress.Parse(Expression)<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;With IPAddress<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Return (System.Convert.ToInt32(.GetAddressBytes(3)) &lt;&lt; 24) Or (System.Convert.ToInt32(.GetAddressBytes(2)) &lt;&lt; 16) Or (System.Convert.ToInt32(.GetAddressBytes(1)) &lt;&lt; 8) Or System.Convert.ToInt32(.GetAddressBytes(0))<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;End With<br /> &nbsp; &nbsp; &nbsp; &nbsp;Catch ex As Exception<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Return 0<br /> &nbsp; &nbsp; &nbsp; &nbsp;End Try<br /> &nbsp; &nbsp;End Function<br /><br /> &nbsp; &nbsp;Sub Main()<br /> &nbsp; &nbsp; &nbsp; &nbsp;Dim l As Long<br /> &nbsp; &nbsp; &nbsp; &nbsp;l = IPToInteger("192.168.88.1")<br /> &nbsp; &nbsp; &nbsp; &nbsp;Dim mk = New Mikrotik(l)<br /> &nbsp; &nbsp; &nbsp; &nbsp;If Not mk.Login("admin", "pwd") Then<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Console.WriteLine("Не удалось войти в систему")<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;mk.Close()<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Console.ReadLine()<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Return<br /> &nbsp; &nbsp; &nbsp; &nbsp;End If<br /> &nbsp; &nbsp; &nbsp; &nbsp;mk.Send("/system/clock/getall", True)<br /> &nbsp; &nbsp; &nbsp; &nbsp;For Each row In mk.Read()<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Console.WriteLine(row)<br /> &nbsp; &nbsp; &nbsp; &nbsp;Next<br /> &nbsp; &nbsp; &nbsp; &nbsp;Console.ReadLine()<br /> &nbsp; &nbsp;End Sub<br />End Module<br />```<br /><br />Я ничего не менял в классе из вики, поэтому код не прикладываю. <br />
			<i>17.08.2012 10:09:00, slimprize.</i>]]></description>
			<link>http://mikrotik.moscow/forum/forum57/59430-vb-.net_-obshchenie-cherez-ip_adres-routera/message225830</link>
			<guid>http://mikrotik.moscow/forum/forum57/59430-vb-.net_-obshchenie-cherez-ip_adres-routera/message225830</guid>
			<pubDate>Fri, 17 Aug 2012 10:09:00 -0400</pubDate>
			<category>RouterOS</category>
		</item>
	</channel>
</rss>
