<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Csharp on Max Wiki Site</title><link>https://maxtar.github.io/tags/csharp/</link><description>Recent content in Csharp on Max Wiki Site</description><generator>Hugo</generator><language>ru-RU</language><lastBuildDate>Wed, 05 Oct 2022 01:42:05 +0300</lastBuildDate><atom:link href="https://maxtar.github.io/tags/csharp/index.xml" rel="self" type="application/rss+xml"/><item><title>Полезные функции</title><link>https://maxtar.github.io/programming/csharp/useful-func/</link><pubDate>Wed, 05 Oct 2022 01:42:05 +0300</pubDate><guid>https://maxtar.github.io/programming/csharp/useful-func/</guid><description>&lt;div class="gdoc-toc gdoc-toc__level--6">
 &lt;nav id="TableOfContents">
 &lt;ul>
 &lt;li>
 &lt;ul>
 &lt;li>&lt;a href="#преобразование-числа-в-ip-адрес">Преобразование числа в IP-адрес&lt;/a>&lt;/li>
 &lt;li>&lt;a href="#преобразование-ip-адреса-в-число-в-прямом-порядке-be">Преобразование IP-адреса в число в прямом порядке (BE)&lt;/a>&lt;/li>
 &lt;/ul>
 &lt;/li>
 &lt;/ul>
&lt;/nav>
 &lt;hr />
 &lt;/div>
&lt;div class="flex align-center gdoc-page__anchorwrap">
 &lt;h2 id="преобразование-числа-в-ip-адрес"
 >
 Преобразование числа в IP-адрес
 &lt;/h2>
 &lt;a data-clipboard-text="https://maxtar.github.io/programming/csharp/useful-func/#преобразование-числа-в-ip-адрес" class="gdoc-page__anchor clip flex align-center" title=" Преобразование числа в IP-адрес" aria-label=" Преобразование числа в IP-адрес" href="#%d0%bf%d1%80%d0%b5%d0%be%d0%b1%d1%80%d0%b0%d0%b7%d0%be%d0%b2%d0%b0%d0%bd%d0%b8%d0%b5-%d1%87%d0%b8%d1%81%d0%bb%d0%b0-%d0%b2-ip-%d0%b0%d0%b4%d1%80%d0%b5%d1%81">
 &lt;svg class="gdoc-icon gdoc_link">&lt;use xlink:href="#gdoc_link">&lt;/use>&lt;/svg>
 &lt;/a>
&lt;/div>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-c#" data-lang="c#">&lt;span class="line">&lt;span class="cl">&lt;span class="k">new&lt;/span> &lt;span class="n">System&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="n">Net&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="n">IPAddress&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="m">36546&lt;/span>&lt;span class="p">)).&lt;/span>&lt;span class="n">ToString&lt;/span>&lt;span class="p">();&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;div class="flex align-center gdoc-page__anchorwrap">
 &lt;h2 id="преобразование-ip-адреса-в-число-в-прямом-порядке-be"
 >
 Преобразование IP-адреса в число в прямом порядке (BE)
 &lt;/h2>
 &lt;a data-clipboard-text="https://maxtar.github.io/programming/csharp/useful-func/#преобразование-ip-адреса-в-число-в-прямом-порядке-be" class="gdoc-page__anchor clip flex align-center" title=" Преобразование IP-адреса в число в прямом порядке (BE)" aria-label=" Преобразование IP-адреса в число в прямом порядке (BE)" href="#%d0%bf%d1%80%d0%b5%d0%be%d0%b1%d1%80%d0%b0%d0%b7%d0%be%d0%b2%d0%b0%d0%bd%d0%b8%d0%b5-ip-%d0%b0%d0%b4%d1%80%d0%b5%d1%81%d0%b0-%d0%b2-%d1%87%d0%b8%d1%81%d0%bb%d0%be-%d0%b2-%d0%bf%d1%80%d1%8f%d0%bc%d0%be%d0%bc-%d0%bf%d0%be%d1%80%d1%8f%d0%b4%d0%ba%d0%b5-be">
 &lt;svg class="gdoc-icon gdoc_link">&lt;use xlink:href="#gdoc_link">&lt;/use>&lt;/svg>
 &lt;/a>
&lt;/div>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-c#" data-lang="c#">&lt;span class="line">&lt;span class="cl">&lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kt">byte&lt;/span>&lt;span class="p">[]&lt;/span> &lt;span class="n">ipNums&lt;/span> &lt;span class="p">=&lt;/span> &lt;span class="n">ip&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="n">Split&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="sc">&amp;#39;.&amp;#39;&lt;/span>&lt;span class="p">).&lt;/span>&lt;span class="n">Select&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">s&lt;/span> &lt;span class="p">=&amp;gt;&lt;/span> &lt;span class="kt">byte&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="n">Parse&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">s&lt;/span>&lt;span class="p">)).&lt;/span>&lt;span class="n">ToArray&lt;/span>&lt;span class="p">();&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kt">uint&lt;/span> &lt;span class="n">res&lt;/span> &lt;span class="p">=&lt;/span> &lt;span class="m">0&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">res&lt;/span> &lt;span class="p">=&lt;/span> &lt;span class="n">res&lt;/span> &lt;span class="p">+&lt;/span> &lt;span class="n">ipNums&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="m">0&lt;/span>&lt;span class="p">]&lt;/span> &lt;span class="p">&amp;lt;&amp;lt;&lt;/span> &lt;span class="m">8&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">res&lt;/span> &lt;span class="p">=&lt;/span> &lt;span class="n">res&lt;/span> &lt;span class="p">+&lt;/span> &lt;span class="n">ipNums&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="m">1&lt;/span>&lt;span class="p">]&lt;/span> &lt;span class="p">&amp;lt;&amp;lt;&lt;/span> &lt;span class="m">8&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">res&lt;/span> &lt;span class="p">=&lt;/span> &lt;span class="n">res&lt;/span> &lt;span class="p">+&lt;/span> &lt;span class="n">ipNums&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="m">2&lt;/span>&lt;span class="p">]&lt;/span> &lt;span class="p">&amp;lt;&amp;lt;&lt;/span> &lt;span class="m">8&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">res&lt;/span> &lt;span class="p">=&lt;/span> &lt;span class="n">res&lt;/span> &lt;span class="p">+&lt;/span> &lt;span class="n">ipNums&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="m">3&lt;/span>&lt;span class="p">];&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">return&lt;/span> &lt;span class="n">res&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div></description></item><item><title>Полезные библиотеки</title><link>https://maxtar.github.io/programming/csharp/useful-libs/</link><pubDate>Wed, 05 Oct 2022 01:28:55 +0300</pubDate><guid>https://maxtar.github.io/programming/csharp/useful-libs/</guid><description>&lt;div class="flex align-center gdoc-page__anchorwrap">
 &lt;h2 id="работа-с-базой"
 >
 Работа с базой
 &lt;/h2>
 &lt;a data-clipboard-text="https://maxtar.github.io/programming/csharp/useful-libs/#работа-с-базой" class="gdoc-page__anchor clip flex align-center" title=" Работа с базой" aria-label=" Работа с базой" href="#%d1%80%d0%b0%d0%b1%d0%be%d1%82%d0%b0-%d1%81-%d0%b1%d0%b0%d0%b7%d0%be%d0%b9">
 &lt;svg class="gdoc-icon gdoc_link">&lt;use xlink:href="#gdoc_link">&lt;/use>&lt;/svg>
 &lt;/a>
&lt;/div>
&lt;ul>
&lt;li>&lt;a href="https://github.com/StackExchange/Dapper" target="_blank" >Dapper&lt;svg class="gdoc-icon gdoc_link">&lt;use xlink:href="#gdoc_link">&lt;/use>&lt;/svg>&lt;/a>&lt;/li>
&lt;/ul>
&lt;div class="flex align-center gdoc-page__anchorwrap">
 &lt;h2 id="работа-с-ssh"
 >
 Работа с SSH
 &lt;/h2>
 &lt;a data-clipboard-text="https://maxtar.github.io/programming/csharp/useful-libs/#работа-с-ssh" class="gdoc-page__anchor clip flex align-center" title=" Работа с SSH" aria-label=" Работа с SSH" href="#%d1%80%d0%b0%d0%b1%d0%be%d1%82%d0%b0-%d1%81-ssh">
 &lt;svg class="gdoc-icon gdoc_link">&lt;use xlink:href="#gdoc_link">&lt;/use>&lt;/svg>
 &lt;/a>
&lt;/div>
&lt;ul>
&lt;li>&lt;a href="https://github.com/sshnet/SSH.NET" target="_blank" >SSH.NET&lt;svg class="gdoc-icon gdoc_link">&lt;use xlink:href="#gdoc_link">&lt;/use>&lt;/svg>&lt;/a>. &lt;a href="https:/gist.github.com/piccaso/d963331dcbf20611b094" target="_blank" >Некоторые примеры&lt;svg class="gdoc-icon gdoc_link">&lt;use xlink:href="#gdoc_link">&lt;/use>&lt;/svg>&lt;/a>.&lt;/li>
&lt;/ul></description></item><item><title>C#</title><link>https://maxtar.github.io/programming/csharp/</link><pubDate>Mon, 03 Oct 2022 21:59:43 +0300</pubDate><guid>https://maxtar.github.io/programming/csharp/</guid><description>&lt;p>Заметки по .NET&lt;/p>
&lt;div class="gdoc-toc gdoc-toc__level--6">
 &lt;nav id="TableOfContents">
 &lt;ul>
 &lt;li>
 &lt;ul>
 &lt;li>&lt;a href="#вызов-асинхронного-метода-из-синхронного">Вызов асинхронного метода из синхронного&lt;/a>&lt;/li>
 &lt;/ul>
 &lt;/li>
 &lt;/ul>
&lt;/nav>
 &lt;hr />
 &lt;/div>
&lt;div class="flex align-center gdoc-page__anchorwrap">
 &lt;h2 id="вызов-асинхронного-метода-из-синхронного"
 >
 Вызов асинхронного метода из синхронного
 &lt;/h2>
 &lt;a data-clipboard-text="https://maxtar.github.io/programming/csharp/#вызов-асинхронного-метода-из-синхронного" class="gdoc-page__anchor clip flex align-center" title=" Вызов асинхронного метода из синхронного" aria-label=" Вызов асинхронного метода из синхронного" href="#%d0%b2%d1%8b%d0%b7%d0%be%d0%b2-%d0%b0%d1%81%d0%b8%d0%bd%d1%85%d1%80%d0%be%d0%bd%d0%bd%d0%be%d0%b3%d0%be-%d0%bc%d0%b5%d1%82%d0%be%d0%b4%d0%b0-%d0%b8%d0%b7-%d1%81%d0%b8%d0%bd%d1%85%d1%80%d0%be%d0%bd%d0%bd%d0%be%d0%b3%d0%be">
 &lt;svg class="gdoc-icon gdoc_link">&lt;use xlink:href="#gdoc_link">&lt;/use>&lt;/svg>
 &lt;/a>
&lt;/div>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-c#" data-lang="c#">&lt;span class="line">&lt;span class="cl">&lt;span class="kt">var&lt;/span> &lt;span class="n">task&lt;/span> &lt;span class="p">=&lt;/span> &lt;span class="n">Task&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="n">Run&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="kd">async&lt;/span> &lt;span class="p">()&lt;/span> &lt;span class="p">=&amp;gt;&lt;/span> &lt;span class="k">await&lt;/span> &lt;span class="n">MyAsyncFunction&lt;/span>&lt;span class="p">())&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="n">task&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="n">Wait&lt;/span>&lt;span class="p">();&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="kt">var&lt;/span> &lt;span class="n">asyncFunctionResult&lt;/span> &lt;span class="p">=&lt;/span> &lt;span class="n">task&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="n">Result&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div></description></item></channel></rss>