<?xml version='1.0' encoding="utf-8"?>
      <rss version='2.0'>
      <channel>
      <title>Форум на Исходниках.RU</title>
      <link>https://forum.sources.ru</link>
      <description>Форум на Исходниках.RU</description>
      <generator>Форум на Исходниках.RU</generator>
  	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=261187&amp;view=findpost&amp;p=2493301</guid>
        <pubDate>Tue, 02 Feb 2010 10:36:53 +0000</pubDate>
        <title>select * from Win32_????</title>
        <link>https://forum.sources.ru/index.php?showtopic=261187&amp;view=findpost&amp;p=2493301</link>
        <description><![CDATA[fdevelop: Столкнулся с аналогичной же проблемой, помучался  :) <br>
Объект в итоге получить очень просто: из той строки, что он тебе выдает очень легко сформулировать очередной WQL запрос. Например,<br>
из строки<br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">\ACER\root\cimv2:Win32_PnPEntity.DeviceID=&quot;USBSTOR\DISK&amp;VEN_T.SONIC&amp;PROD_820&amp;REV_\10004020200001210064&amp;0&quot;</div></ol></div></div></div></div><script>preloadCodeButtons('1');</script><br>
очень нетрудно создать такой запрос:<br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">ManagementObjectSearcher s2 = new ManagementObjectSearcher(@&quot;\ACER\root\cimv2&quot;,@&quot;SELECT * FROM Win32_PnPEntity WHERE</div><div class="code_line">&nbsp;DeviceID=&#39;USBSTOR\DISK&amp;VEN_T.SONIC&amp;PROD_820&amp;REV_\10004020200001210064&amp;0&#39;&quot;);</div></ol></div></div></div></div><br>
А далее, уже методом Get() получаешь коллекцию, с которой смело можно работать<br>
<br>
(думаю, можно еще проще сделать запрос, но пока не понял как  :) )]]></description>
        <author>fdevelop</author>
        <category>.NET: Общие вопросы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=261187&amp;view=findpost&amp;p=2160095</guid>
        <pubDate>Mon, 05 Jan 2009 14:47:35 +0000</pubDate>
        <title>select * from Win32_????</title>
        <link>https://forum.sources.ru/index.php?showtopic=261187&amp;view=findpost&amp;p=2160095</link>
        <description><![CDATA[Fox: решил пойти другим путем :)<br>
<br>
перебираю поля USBControllerDevice (там в поле Dependent есть чтото весьма похожее на путь в реестр, откуда можно снять информацию о порте собственно)<br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">public SomeScanFunc()</div><div class="code_line">{</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ManagementClass c = new ManagementClass(&quot;Win32_USBControllerDevice&quot;);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;foreach (ManagementObject o in c.GetInstances())</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;try</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;string path = o[&quot;Dependent&quot;].ToString();</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;RegistryKey key = Registry.LocalMachine.OpenSubKey(path);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;catch { }</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</div><div class="code_line">}</div></ol></div></div></div></div><br>
только блин этот путь не совсем путь... структура поля следующая:<br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">\Имя компа\root\cimv2:Win32_PnPEntity.DeviceID=\&quot;USB\ROOT_HUB\4&amp;74BD3DD&amp;0\&quot;</div></ol></div></div></div></div><br>
собственно часть &quot;USB&#092;&#092;ROOT_HUB&#092;&#092;4&amp;74BD3DD&amp;0&#092;&quot; есть куском пути. :) если впереди дописать &quot;HKEY_LOCAL_MACHINE&#092;SYSTEM&#092;CurrentControlSet&#092;Enum&#092;&quot; то получим полный путь в реестре для этого устройства, после чего оттуда можно выковырять инфу о присвоеном номере порта и т д<br>
<br>
уж больно мутно но пока так :( <br>
буду рад если кто поправит меня - как это сделать проще?<br>
<br>
<br>
и еще попутно для знатоков вопрос:<br>
поле Dependent класа Win32_USBControllerDevice есть ссылка на (обьект?) CIM_LogicalDevice ?<br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">class Win32_USBControllerDevice : CIM_ControlledBy</div><div class="code_line">{</div><div class="code_line">&nbsp;&nbsp;uint16 AccessState;</div><div class="code_line">&nbsp;&nbsp;CIM_USBController ref Antecedent;// как получить отсюда обьект типа CIM_USBController?</div><div class="code_line">&nbsp;&nbsp;CIM_LogicalDevice ref Dependent;</div><div class="code_line">&nbsp;&nbsp;uint32 NegotiatedDataWidth;</div><div class="code_line">&nbsp;&nbsp;uint64 NegotiatedSpeed;</div><div class="code_line">&nbsp;&nbsp;uint32 NumberOfHardResets;</div><div class="code_line">&nbsp;&nbsp;uint32 NumberOfSoftResets;</div><div class="code_line">};</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;class CIM_LogicalDevice</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;{</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;UInt16 Availability;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;string Caption;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;UInt32 ConfigManagerErrorCode;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;bool ConfigManagerUserConfig;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;string CreationClassName;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;string Description;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;string DeviceID;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;bool ErrorCleared;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;string ErrorDescription;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;DateTime InstallDate;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;UInt32 LastErrorCode;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;string Name;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;string PNPDeviceID;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;UInt16[] PowerManagementCapabilities;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;bool PowerManagementSupported;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;string Status;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;UInt16 StatusInfo;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;string SystemCreationClassName;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;string SystemName;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;}</div></ol></div></div></div></div><br>
собственно вопрос - как получить из длинной некрасивой строки Dependent красивый обьект класса CIM_LogicalDevice? <br>
первое что пришло в голову - создал класс CIM_LogicalDevice и попробовал привести [Dependent] к (CIM_LogicalDevice) :) естественно ничего не получилось :) смутно понимаю что делается это ансейфным кодом через ссылки но не понимаю как именно :)]]></description>
        <author>Fox</author>
        <category>.NET: Общие вопросы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=261187&amp;view=findpost&amp;p=2159856</guid>
        <pubDate>Mon, 05 Jan 2009 10:36:39 +0000</pubDate>
        <title>select * from Win32_????</title>
        <link>https://forum.sources.ru/index.php?showtopic=261187&amp;view=findpost&amp;p=2159856</link>
        <description><![CDATA[Fox: хм... похоже всетаки нарыл то чт мне нужно :)<br>http://www.delphi3000.com/articles/article_4001.asp?SK=<br>если кому интересно.. правда не на шарпе... мозгодробилка блин... думал будет проще]]></description>
        <author>Fox</author>
        <category>.NET: Общие вопросы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=261187&amp;view=findpost&amp;p=2159200</guid>
        <pubDate>Sun, 04 Jan 2009 11:08:12 +0000</pubDate>
        <title>select * from Win32_????</title>
        <link>https://forum.sources.ru/index.php?showtopic=261187&amp;view=findpost&amp;p=2159200</link>
        <description><![CDATA[Fox: таки нету вроде непосредственного WMI в свойствах которого будет метка на компорт...<br>таки любоптно - как их вычисляет девайс манагер в красивом виде...<br>чтото мне подсказывает что как ПнП девайс... но как оттуда вытащить имя порта...?<br><br><br>цена вопроса 10 баксов :) (в пределах Украины могу выслать пополняшкой счета или еще как... спасайте :( )]]></description>
        <author>Fox</author>
        <category>.NET: Общие вопросы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=261187&amp;view=findpost&amp;p=2156982</guid>
        <pubDate>Tue, 30 Dec 2008 15:13:34 +0000</pubDate>
        <title>select * from Win32_????</title>
        <link>https://forum.sources.ru/index.php?showtopic=261187&amp;view=findpost&amp;p=2156982</link>
        <description><![CDATA[Fox: боюсь комп этого не переживет:)<br>и так на многи запросы комп зависает...<br><br>думал может кто подскажет...]]></description>
        <author>Fox</author>
        <category>.NET: Общие вопросы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=261187&amp;view=findpost&amp;p=2156972</guid>
        <pubDate>Tue, 30 Dec 2008 15:00:00 +0000</pubDate>
        <title>select * from Win32_????</title>
        <link>https://forum.sources.ru/index.php?showtopic=261187&amp;view=findpost&amp;p=2156972</link>
        <description><![CDATA[debugx: <strong class='tag-b'>Fox</strong>, а как насчет того, чтобы слить всю базу WMI со всеми классами и свойствами в текстовый файлик, и поискать в нем слово COM?]]></description>
        <author>debugx</author>
        <category>.NET: Общие вопросы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=261187&amp;view=findpost&amp;p=2156960</guid>
        <pubDate>Tue, 30 Dec 2008 14:34:30 +0000</pubDate>
        <title>select * from Win32_????</title>
        <link>https://forum.sources.ru/index.php?showtopic=261187&amp;view=findpost&amp;p=2156960</link>
        <description><![CDATA[Fox: думаю придутся брать инфу о юсб всетаки с реестра както по идентификатору ЮСБ устройства чтоли... только вот как это сделать представляю смутно.<br><br>обидно что не получилось найти ВМИ клас с этой инфой, а ведь он есть 100%...]]></description>
        <author>Fox</author>
        <category>.NET: Общие вопросы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=261187&amp;view=findpost&amp;p=2156941</guid>
        <pubDate>Tue, 30 Dec 2008 14:15:38 +0000</pubDate>
        <title>select * from Win32_????</title>
        <link>https://forum.sources.ru/index.php?showtopic=261187&amp;view=findpost&amp;p=2156941</link>
        <description><![CDATA[Vladimir: <div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=261187&view=findpost&p=2156920'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>Fox &#064; <time class="tag-quote__quoted-time" datetime="2008-12-30T13:57:47+00:00">30.12.08, 13:57</time></span><div class='quote '>хорошо  вопрос тогда - откуда винда берет инфу в девайс менагер о компортах? </div></div><br>
<br>
<br>
Хороший вопрос&#33;  :D]]></description>
        <author>Vladimir</author>
        <category>.NET: Общие вопросы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=261187&amp;view=findpost&amp;p=2156920</guid>
        <pubDate>Tue, 30 Dec 2008 13:57:47 +0000</pubDate>
        <title>select * from Win32_????</title>
        <link>https://forum.sources.ru/index.php?showtopic=261187&amp;view=findpost&amp;p=2156920</link>
        <description><![CDATA[Fox: хорошо :) вопрос тогда - откуда винда берет инфу в девайс менагер о компортах?:)]]></description>
        <author>Fox</author>
        <category>.NET: Общие вопросы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=261187&amp;view=findpost&amp;p=2156894</guid>
        <pubDate>Tue, 30 Dec 2008 13:38:04 +0000</pubDate>
        <title>select * from Win32_????</title>
        <link>https://forum.sources.ru/index.php?showtopic=261187&amp;view=findpost&amp;p=2156894</link>
        <description><![CDATA[Vladimir: <div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=261187&view=findpost&p=2156889'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>Fox &#064; <time class="tag-quote__quoted-time" datetime="2008-12-30T13:34:33+00:00">30.12.08, 13:34</time></span><div class='quote '>а мне надо юсб </div></div><br>
<br>
<br>
Ютилити дает перечень всех WMI классов и всех их пропертиз, других нету.  :no:]]></description>
        <author>Vladimir</author>
        <category>.NET: Общие вопросы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=261187&amp;view=findpost&amp;p=2156889</guid>
        <pubDate>Tue, 30 Dec 2008 13:34:33 +0000</pubDate>
        <title>select * from Win32_????</title>
        <link>https://forum.sources.ru/index.php?showtopic=261187&amp;view=findpost&amp;p=2156889</link>
        <description><![CDATA[Fox: Win32_SerialPort отдает только железные порты<br>а у тебя ноут скорее всего потому их нету.<br><br>а мне надо юсб :(]]></description>
        <author>Fox</author>
        <category>.NET: Общие вопросы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=261187&amp;view=findpost&amp;p=2156854</guid>
        <pubDate>Tue, 30 Dec 2008 12:58:26 +0000</pubDate>
        <title>select * from Win32_????</title>
        <link>https://forum.sources.ru/index.php?showtopic=261187&amp;view=findpost&amp;p=2156854</link>
        <description><![CDATA[Vladimir: <div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=261187&view=findpost&p=2156841'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>Fox &#064; <time class="tag-quote__quoted-time" datetime="2008-12-30T12:43:29+00:00">30.12.08, 12:43</time></span><div class='quote '>COM2 например </div></div><br>
<br>
<br>
<br>
Так значит нужен меппинг USB и виртуальных COM портов? Неслабая задачка... :yes-sad: <br>
<br>
<span class="tag-color tag-color-named" data-value="gray" style="color: gray"><span class='tag-size' data-value='7' style='font-size:7pt;'>Добавлено <time class="tag-mergetime" datetime="2008-12-30T13:03:08+00:00">30.12.08, 13:03</time></span></span><br>
У меня на машине их вообще нет:<br>
<br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">ManagementObjectSearcher searcher = new ManagementObjectSearcher(&quot;SELECT * FROM Win32_SerialPort&quot;);</div><div class="code_line">Console.WriteLine(searcher.Get().Count);</div></ol></div></div></div></div><br>
<br>
Возвращает 0  :no-sad: <br>
<br>
<span class="tag-color tag-color-named" data-value="gray" style="color: gray"><span class='tag-size' data-value='7' style='font-size:7pt;'>Добавлено <time class="tag-mergetime" datetime="2008-12-30T13:07:28+00:00">30.12.08, 13:07</time></span></span><br>
Во, вроде есть утилити, чтобы жизнь облегчить:<br>
<br>
http://www.microsoft.com/downloads/details.aspx?familyid=2CC30A64-EA15-4661-8DA4-55BBC145C30E&displaylang=en <br>
<br>
<span class="tag-color tag-color-named" data-value="gray" style="color: gray"><span class='tag-size' data-value='7' style='font-size:7pt;'>Добавлено <time class="tag-mergetime" datetime="2008-12-30T13:12:42+00:00">30.12.08, 13:12</time></span></span><br>
WMI классы находятся в root&#092;CIMV2 неймспейсе]]></description>
        <author>Vladimir</author>
        <category>.NET: Общие вопросы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=261187&amp;view=findpost&amp;p=2156841</guid>
        <pubDate>Tue, 30 Dec 2008 12:43:29 +0000</pubDate>
        <title>select * from Win32_????</title>
        <link>https://forum.sources.ru/index.php?showtopic=261187&amp;view=findpost&amp;p=2156841</link>
        <description><![CDATA[Fox: в таком чтобы можно было получить доступ к порту. в таком как он отображается в менеджере устройств винды.<br><br>COM2 например :) или СОМ50 или СОМ100 :) ну короче СОМ<br><br>и именно через ВМИ класы. искать в реестре и т д не предлагать.]]></description>
        <author>Fox</author>
        <category>.NET: Общие вопросы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=261187&amp;view=findpost&amp;p=2156652</guid>
        <pubDate>Tue, 30 Dec 2008 09:10:30 +0000</pubDate>
        <title>select * from Win32_????</title>
        <link>https://forum.sources.ru/index.php?showtopic=261187&amp;view=findpost&amp;p=2156652</link>
        <description><![CDATA[Vladimir: <div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=261187&view=findpost&p=2156650'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>Fox &#064; <time class="tag-quote__quoted-time" datetime="2008-12-30T09:07:57+00:00">30.12.08, 09:07</time></span><div class='quote '> я ищу именно имя порта,</div></div><br>
<br>
А в каком виде имя должно быть записано?]]></description>
        <author>Vladimir</author>
        <category>.NET: Общие вопросы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=261187&amp;view=findpost&amp;p=2156650</guid>
        <pubDate>Tue, 30 Dec 2008 09:07:57 +0000</pubDate>
        <title>select * from Win32_????</title>
        <link>https://forum.sources.ru/index.php?showtopic=261187&amp;view=findpost&amp;p=2156650</link>
        <description><![CDATA[Fox: это все понятно, но проблема в том, что я ищу именно имя порта, а весь остальной набор веселых параметров безсловно полезен и интересен но мне абсолютно не нужен.<br><br>перебор свойств ВМИ класов, в именах которых вствречается &quot;юсб&quot;, &quot;ком&quot; или &quot;порт&quot;, я уже давно сделал, но нихрена не нашол.]]></description>
        <author>Fox</author>
        <category>.NET: Общие вопросы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=261187&amp;view=findpost&amp;p=2156594</guid>
        <pubDate>Tue, 30 Dec 2008 07:57:28 +0000</pubDate>
        <title>select * from Win32_????</title>
        <link>https://forum.sources.ru/index.php?showtopic=261187&amp;view=findpost&amp;p=2156594</link>
        <description><![CDATA[Vladimir: <div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=261187&view=findpost&p=2156044'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>Fox &#064; <time class="tag-quote__quoted-time" datetime="2008-12-29T16:53:04+00:00">29.12.08, 16:53</time></span><div class='quote '>информации о номере компорта там не нашол </div></div><br>
<br>
Это все, что оттуда вытянул на скорую руку.<br>
<br>
<br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">ManagementObjectSearcher searcher = new ManagementObjectSearcher(&quot;select * from Win32_USBHub&quot;);</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;foreach (ManagementObject mo in searcher.Get())</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Console.WriteLine(mo[&quot;Name&quot;]);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Console.WriteLine(mo[&quot;DeviceID&quot;]);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Console.WriteLine(mo[&quot;Status&quot;]);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</div></ol></div></div></div></div><br>
<br>
<br>
Пустые порты выдают типа<br>
<br>
USB-mainhub<br>
USB&#092;ROOT_HUB&#092;4&amp;14C69700&amp;0<br>
OK<br>
<br>
После подключения ЮСБ мемори-стик изменилось на<br>
<br>
<br>
USB-storage device<br>
USB&#092;VID_1043&amp;PID_8006&#092;200506090855<br>
OK <br>
<br>
<span class="tag-color tag-color-named" data-value="gray" style="color: gray"><span class='tag-size' data-value='7' style='font-size:7pt;'>Добавлено <time class="tag-mergetime" datetime="2008-12-30T08:04:05+00:00">30.12.08, 08:04</time></span></span><br>
Win32_USBController выдает примерно то же самое:<br>
<br>
<br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">ManagementObjectSearcher searcher = new ManagementObjectSearcher(&quot;SELECT * FROM Win32_USBController&quot;);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;foreach (ManagementObject queryObj in searcher.Get()) &nbsp; </div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ &nbsp; </div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Console.WriteLine(&quot;-----------------------------------&quot;); &nbsp; </div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Console.WriteLine(&quot;Win32_USBController instance&quot;); &nbsp; </div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Console.WriteLine(&quot;-----------------------------------&quot;); &nbsp; &nbsp; </div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Console.WriteLine(queryObj[&quot;Caption&quot;]); &nbsp; </div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Console.WriteLine(queryObj[&quot;ConfigManagerUserConfig&quot;]); &nbsp; </div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Console.WriteLine(queryObj[&quot;DeviceID&quot;]);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Console.WriteLine(queryObj[&quot;Manufacturer&quot;]); &nbsp; </div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Console.WriteLine(queryObj[&quot;ProtocolSupported&quot;]); &nbsp; </div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Console.WriteLine(queryObj[&quot;Status&quot;]); &nbsp; </div><div class="code_line">&nbsp;&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</div></ol></div></div></div></div> <br>
<br>
<span class="tag-color tag-color-named" data-value="gray" style="color: gray"><span class='tag-size' data-value='7' style='font-size:7pt;'>Добавлено <time class="tag-mergetime" datetime="2008-12-30T08:11:33+00:00">30.12.08, 08:11</time></span></span><br>
Вот все пропертиз класса Win32_USBControllerDevice , других там нету            <br>
<br>
<br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">ManagementObjectSearcher searcher = new ManagementObjectSearcher(&quot;SELECT * FROM Win32_USBControllerDevice&quot;);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;foreach (ManagementObject queryObj in searcher.Get())</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Console.WriteLine(&quot;-----------------------------------&quot;);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Console.WriteLine(&quot;Win32_USBControllerDevice instance&quot;);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Console.WriteLine(&quot;-----------------------------------&quot;);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Console.WriteLine(queryObj[&quot;AccessState&quot;]);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Console.WriteLine(queryObj[&quot;Antecedent&quot;]);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Console.WriteLine(queryObj[&quot;Dependent&quot;]);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Console.WriteLine(queryObj[&quot;NegotiatedDataWidth&quot;]);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Console.WriteLine(queryObj[&quot;NegotiatedSpeed&quot;]);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Console.WriteLine(queryObj[&quot;NumberOfHardResets&quot;]);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Console.WriteLine(queryObj[&quot;NumberOfSoftResets&quot;]);</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</div></ol></div></div></div></div>]]></description>
        <author>Vladimir</author>
        <category>.NET: Общие вопросы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=261187&amp;view=findpost&amp;p=2156205</guid>
        <pubDate>Mon, 29 Dec 2008 18:17:15 +0000</pubDate>
        <title>select * from Win32_????</title>
        <link>https://forum.sources.ru/index.php?showtopic=261187&amp;view=findpost&amp;p=2156205</link>
        <description><![CDATA[Fox: попросту говоря мне нужно сделать чтото типа окна <br>&quot;Управление компьютером&quot;-&quot;Диспечер устройств&quot;-&quot;Порты КОМ и ЛПТ&quot; :(<br><br> :wall:]]></description>
        <author>Fox</author>
        <category>.NET: Общие вопросы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=261187&amp;view=findpost&amp;p=2156044</guid>
        <pubDate>Mon, 29 Dec 2008 16:53:04 +0000</pubDate>
        <title>select * from Win32_????</title>
        <link>https://forum.sources.ru/index.php?showtopic=261187&amp;view=findpost&amp;p=2156044</link>
        <description><![CDATA[Fox: информации о номере компорта там не нашол]]></description>
        <author>Fox</author>
        <category>.NET: Общие вопросы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=261187&amp;view=findpost&amp;p=2155906</guid>
        <pubDate>Mon, 29 Dec 2008 15:15:58 +0000</pubDate>
        <title>select * from Win32_????</title>
        <link>https://forum.sources.ru/index.php?showtopic=261187&amp;view=findpost&amp;p=2155906</link>
        <description><![CDATA[Vladimir: <div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=261187&view=findpost&p=2155596'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>Fox &#064; <time class="tag-quote__quoted-time" datetime="2008-12-29T10:23:44+00:00">29.12.08, 10:23</time></span><div class='quote '>в Win32_USBControler точно нету</div></div><br>
<br>
<br>
A в Win32_USBHub?  :huh:]]></description>
        <author>Vladimir</author>
        <category>.NET: Общие вопросы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=261187&amp;view=findpost&amp;p=2155596</guid>
        <pubDate>Mon, 29 Dec 2008 10:23:44 +0000</pubDate>
        <title>select * from Win32_????</title>
        <link>https://forum.sources.ru/index.php?showtopic=261187&amp;view=findpost&amp;p=2155596</link>
        <description><![CDATA[Fox: ищу WMI клас, хранящий информацию о диагностических портах оборудования (USB)<br>
<br>
нашол модемы и сериал порт<br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">Модемы в системе:</div><div class="code_line">&nbsp;ManagementObjectSearcher searcher = new ManagementObjectSearcher(&quot;select * from Win32_POTSModem&quot;);</div><div class="code_line">Физические порты(COM ports):</div><div class="code_line">&nbsp;searcher = new ManagementObjectSearcher(&quot;select * from Win32_SerialPort&quot;);</div></ol></div></div></div></div><br>
<br>
гдето в этих класах(WMI) есть инфа о диагностических ЮСБ портах...<br>
<br>
в Win32_USBControler точно нету, а вот вроде как есть чтото интересное в Win32_USBControlerDevice... но я не понимаю как пользоваться информацией предоставляемой этим класом :( для модемов все понятно, для компорта тоже, а вот для этого бред какойто - мне собственно нужно узнать к какому физпорту(КОМ) приатачено ЮСБ устройство...]]></description>
        <author>Fox</author>
        <category>.NET: Общие вопросы</category>
      </item>
	
      </channel>
      </rss>
	