<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Willy's blog]]></title><description><![CDATA[Willy's blog]]></description><link>https://blog.wchu.net</link><image><url>https://cdn.hashnode.com/res/hashnode/image/upload/v1681655382051/KpUyLX8RC.png</url><title>Willy&apos;s blog</title><link>https://blog.wchu.net</link></image><generator>RSS for Node</generator><lastBuildDate>Tue, 14 Apr 2026 03:45:21 GMT</lastBuildDate><atom:link href="https://blog.wchu.net/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[iOS 文字編輯手勢清單]]></title><description><![CDATA[用了 iPhone 四年多，還是有一些手勢不太習慣，因此筆記下來。
使用限制
本文內容必須在「輸入區域」內操作，例如備忘錄或 Safari 搜尋框（不含搜尋框外的區域）。由於 iPhone 螢幕空間有限，有些手勢實際上並不是那麼好用。
有些手勢在 iPadOS 可能也適用，但由於比較少用 iPad，就沒有針對 iPad 撰文了。
在未選取文字的狀態

單指點 2 下：選取字詞

單指點 3 下：選取整個段落

雙指滑動：移動游標

雙指點 1 下：選取游標所在處的字詞

雙指點 2 下：選取游標...]]></description><link>https://blog.wchu.net/ios-text-gestures</link><guid isPermaLink="true">https://blog.wchu.net/ios-text-gestures</guid><category><![CDATA[iOS]]></category><dc:creator><![CDATA[Willy Chu]]></dc:creator><pubDate>Tue, 28 Jan 2025 09:53:53 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1738223326275/1efc47ae-91d8-4750-983d-38a7d014e444.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>用了 iPhone 四年多，還是有一些手勢不太習慣，因此筆記下來。</p>
<h1 id="heading-5l255so6zmq5yi2">使用限制</h1>
<p>本文內容必須在「輸入區域」內操作，例如備忘錄或 Safari 搜尋框（不含搜尋框外的區域）。由於 iPhone 螢幕空間有限，有些手勢實際上並不是那麼好用。</p>
<p>有些手勢在 iPadOS 可能也適用，但由於比較少用 iPad，就沒有針對 iPad 撰文了。</p>
<h1 id="heading-5zyo5pyq6yg45yw5pah5a2x55qe54ua5owl">在未選取文字的狀態</h1>
<ul>
<li><p><strong>單指點 2 下：</strong>選取字詞</p>
</li>
<li><p><strong>單指點 3 下：</strong>選取整個段落</p>
</li>
<li><p><strong>雙指滑動：</strong>移動游標</p>
</li>
<li><p><strong>雙指點 1 下：</strong>選取游標所在處的字詞</p>
</li>
<li><p><strong>雙指點 2 下：</strong>選取游標所在處的段落</p>
</li>
</ul>
<h1 id="heading-5zyo5bey6yg45yw5pah5a2x55qe54ua5owl">在已選取文字的狀態</h1>
<ul>
<li><p><strong>久按並拖曳：</strong>移動選取的文字（選取的文字似乎不能太短）</p>
</li>
<li><p><strong>雙指拖曳：</strong>往前選或往後選（這我有點不太確定）</p>
</li>
</ul>
<h1 id="heading-5pah5a2x5pon5l2c">文字操作</h1>
<ul>
<li><p><strong>三指往內：</strong>拷貝</p>
</li>
<li><p><strong>三指往內兩次：</strong>剪下</p>
</li>
<li><p><strong>三指往外：</strong>貼上</p>
</li>
<li><p><strong>三指左滑：</strong>還原</p>
</li>
<li><p><strong>三指右滑：</strong>重做</p>
</li>
<li><p><strong>雙指點 3 下：</strong>叫出工具列（依序包含還原、剪下、拷貝、貼上、重做）</p>
</li>
</ul>
<h1 id="heading-app">番外篇：內建的照片 APP 也能用！</h1>
<p>有些手勢（例如還原與重做）其實也可以在照片 APP 中使用，但由於照片 APP 也有自己的手勢，所以使用起來就感覺有些衝突。</p>
]]></content:encoded></item><item><title><![CDATA[解決 ReSharper AI Chat 異常顯示 “AI Assistant is out of volume” 訊息的方法]]></title><description><![CDATA[如果在使用 JetBrains ReSharper 的 AI Chat 時遇到 “AI Assistant is out of volume” 的訊息，但在另一台電腦上卻能正常使用，這可能是觸發了某些 bug。可以透過以下步驟來解決此問題（適用於 Resharper 2024.1 及後續版本）：

首先，進入 Visual Studio 的功能表列，選擇 ReSharper → Navigate → Go to Action。

接著，執行以下指令。請注意，執行此指令後，Visual Studi...]]></description><link>https://blog.wchu.net/resharper-ai-assistant-out-of-volume</link><guid isPermaLink="true">https://blog.wchu.net/resharper-ai-assistant-out-of-volume</guid><category><![CDATA[visual studio]]></category><category><![CDATA[Resharper]]></category><dc:creator><![CDATA[Willy Chu]]></dc:creator><pubDate>Wed, 01 May 2024 08:14:40 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1738222898500/569654a5-b01c-4bbc-9873-6d6cdf365824.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>如果在使用 JetBrains ReSharper 的 AI Chat 時遇到 “AI Assistant is out of volume” 的訊息，但在另一台電腦上卻能正常使用，這可能是觸發了某些 bug。可以透過以下步驟來解決此問題（適用於 Resharper 2024.1 及後續版本）：</p>
<ol>
<li><p>首先，進入 Visual Studio 的功能表列，選擇 ReSharper → Navigate → Go to Action。</p>
</li>
<li><p>接著，執行以下指令。請注意，執行此指令後，Visual Studio 將會重啟，並且 JetBrains Account 也會被登出，因此建議先做好設定的備份。</p>
<pre><code class="lang-plaintext"> /internal Reset JetBrains Account and JetBrains AI settings
</code></pre>
</li>
<li><p>當 Visual Studio 重啟後，請進入功能表列的 ReSharper → Help → License Information，並重新登入 JetBrains Account。</p>
</li>
<li><p>最後，再次開啟 AI Chat，這時候 AI Chat 畫面上的 Login、Connect、Retry 按鈕應該就可以正常執行了。</p>
</li>
</ol>
<p>如果正在使用的是 2024.1 之前的版本，可以參考以下的參考文章。</p>
<p>參考文章：</p>
<ul>
<li><a target="_blank" href="https://resharper-support.jetbrains.com/hc/en-us/articles/15709095653010-AI-Assistant-authorization-issues-incorrect-out-of-volume-message">AI Assistant authorization issues/incorrect "out of volume" message</a></li>
</ul>
]]></content:encoded></item><item><title><![CDATA[讓 Visual Studio 在使用 Ctrl+F 搜尋字詞時，預設搜尋範圍不要限制在「選取範圍」]]></title><description><![CDATA[在 Visual Studio 中，當你選取一段文字並按下 Ctrl+F 進行搜尋時，預設的行為是只在「選取範圍」內搜尋。

如果想要改變這個行為，讓 Ctrl+F 可以在「目前的文件」中搜尋，而不只是在「選取範圍」，可以參考以下的步驟：

工具 → 選項

環境 → 尋找和取代

將「自動將搜尋範圍限制在選取範圍」取消勾選


完成以上步驟後，當按下 Ctrl+F 進行搜尋時，就會在「目前的文件」中搜尋，而不只是在「選取範圍」內。]]></description><link>https://blog.wchu.net/visual-studio-search-scope</link><guid isPermaLink="true">https://blog.wchu.net/visual-studio-search-scope</guid><category><![CDATA[visual studio]]></category><dc:creator><![CDATA[Willy Chu]]></dc:creator><pubDate>Sat, 30 Mar 2024 12:57:47 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1738220966920/c91d47b2-9596-48a0-91ee-78a38ea0ce5a.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>在 Visual Studio 中，當你選取一段文字並按下 Ctrl+F 進行搜尋時，預設的行為是只在「選取範圍」內搜尋。</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1711798558222/f3939d63-1980-41b5-98fc-32a93d0ab0dd.png" alt class="image--center mx-auto" /></p>
<p>如果想要改變這個行為，讓 Ctrl+F 可以在「目前的文件」中搜尋，而不只是在「選取範圍」，可以參考以下的步驟：</p>
<ol>
<li><p>工具 → 選項</p>
</li>
<li><p>環境 → 尋找和取代</p>
</li>
<li><p>將「自動將搜尋範圍限制在選取範圍」取消勾選</p>
</li>
</ol>
<p>完成以上步驟後，當按下 Ctrl+F 進行搜尋時，就會在「目前的文件」中搜尋，而不只是在「選取範圍」內。</p>
]]></content:encoded></item><item><title><![CDATA[記錄在 PowerShell 安裝 Oh My Posh 的過程]]></title><description><![CDATA[最近發現許多開發者使用 Oh My Posh 來提升 PowerShell 的生產力，因此研究了一下它的安裝方式。本篇文章將記錄我的操作流程，內容主要以完成基礎安裝為主，若需更進階的功能，可參考文章末尾提供的相關連結。
安裝流程

開啟 Windows Terminal 的 Windows PowerShell

安裝 PowerShell（支援跨平台的版本）
 winget install Microsoft.PowerShell


重新啟動 Windows Terminal，並使用 Pow...]]></description><link>https://blog.wchu.net/install-oh-my-posh-in-powershell</link><guid isPermaLink="true">https://blog.wchu.net/install-oh-my-posh-in-powershell</guid><category><![CDATA[Powershell]]></category><dc:creator><![CDATA[Willy Chu]]></dc:creator><pubDate>Mon, 09 Oct 2023 12:28:42 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1738223178893/ec2e9076-b438-4ba7-a5a9-8e6d5afa016b.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>最近發現許多開發者使用 <a target="_blank" href="https://ohmyposh.dev/">Oh My Posh</a> 來提升 PowerShell 的生產力，因此研究了一下它的安裝方式。本篇文章將記錄我的操作流程，內容主要以完成基礎安裝為主，若需更進階的功能，可參考文章末尾提供的相關連結。</p>
<h1 id="heading-5a6j6kod5rwb56il">安裝流程</h1>
<ol>
<li><p>開啟 Windows Terminal 的 Windows PowerShell</p>
</li>
<li><p>安裝 PowerShell（支援跨平台的版本）</p>
<pre><code class="lang-powershell"> winget install Microsoft.PowerShell
</code></pre>
</li>
<li><p>重新啟動 Windows Terminal，並使用 PowerShell</p>
 <div data-node-type="callout">
 <div data-node-type="callout-emoji">💡</div>
 <div data-node-type="callout-text">注意要選擇前一步驟安裝的 PowerShell（版本為 7.x），而非 Windows PowerShell（版本為 5.x）</div>
 </div>
</li>
<li><p>檢查下列指令的執行結果是否為 RemoteSigned</p>
<pre><code class="lang-powershell"> <span class="hljs-built_in">Get-ExecutionPolicy</span>
</code></pre>
</li>
<li><p>安裝 Oh My Posh</p>
<pre><code class="lang-powershell"> winget install JanDeDobbeleer.OhMyPosh <span class="hljs-literal">-s</span> winget
</code></pre>
</li>
<li><p>安裝字型，選擇 Cascadia Code（此指令需要使用系統管理員身分執行）</p>
<pre><code class="lang-powershell"> <span class="hljs-built_in">oh</span><span class="hljs-literal">-my</span><span class="hljs-literal">-posh</span> font install -<span class="hljs-literal">-user</span>
</code></pre>
</li>
<li><p>重新開啟 Windows Terminal，在「設定 &gt; 設定檔 &gt; PowerShell &gt; 其他設定 &gt; 外觀 &gt; 字體」將字體設為 CaskaydiaCove Nerd Font Mono</p>
</li>
<li><p>檢查下列指令的執行結果是否為 pwsh</p>
<pre><code class="lang-powershell"> <span class="hljs-built_in">oh</span><span class="hljs-literal">-my</span><span class="hljs-literal">-posh</span> get shell
</code></pre>
</li>
<li><p>開啟設定檔</p>
<pre><code class="lang-powershell"> notepad <span class="hljs-variable">$PROFILE</span>
</code></pre>
 <div data-node-type="callout">
 <div data-node-type="callout-emoji">💡</div>
 <div data-node-type="callout-text">若無法開啟，請執行 <code>New-Item -Path $PROFILE -Type File -Force</code> 指令建立設定檔</div>
 </div>
</li>
<li><p>在設定檔中加入以下內容</p>
<pre><code class="lang-plaintext">oh-my-posh init pwsh | Invoke-Expression
</code></pre>
</li>
<li><p>輸入下列指令使設定檔生效（或是重新開啟 Windows Terminal）</p>
<pre><code class="lang-powershell">. <span class="hljs-variable">$PROFILE</span>
</code></pre>
</li>
</ol>
<h1 id="heading-5bcp5oqa5ben">小技巧</h1>
<ul>
<li><p>在 Windows Terminal 的「設定 &gt; 設定檔 &gt; PowerShell &gt; 命令列」加入 <code>-NoLogo</code> 命令，並重新啟動 Windows Terminal，可將每次啟動顯示的橫幅資訊（如下圖紅框處）隱藏。（<a target="_blank" href="https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_pwsh?view=powershell-7.3#-nologo---nol">相關文件</a>）</p>
<p>  <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1696508202395/2bf9b992-499f-4a93-8634-0cca31d63f48.png" alt class="image--center mx-auto" /></p>
<p>  完整命令如下：</p>
<pre><code class="lang-plaintext">  "C:\Program Files\PowerShell\7\pwsh.exe" -NoLogo
</code></pre>
</li>
<li><p>在 Windows Terminal 的「設定 &gt; 設定檔 &gt; PowerShell &gt; 其他設定 &gt; 外觀 &gt; 字型大小」將字型從 12 改為 13，並重新啟動 Windows Terminal，文字接縫處會變得比較漂亮。</p>
</li>
</ul>
<h1 id="heading-5yd6icd6loh5rqq">參考資源</h1>
<ul>
<li><p><a target="_blank" href="https://blog.miniasp.com/post/2021/11/24/PowerShell-prompt-with-Oh-My-Posh-and-Windows-Terminal">如何打造一個華麗又實用的 PowerShell 命令輸入環境</a></p>
<ul>
<li><p><a target="_blank" href="https://www.youtube.com/watch?v=MA_gIbs6P1c">打造一個華麗又實用的 PowerShell / Bash 命令輸入環境</a></p>
</li>
<li><p>“PowerShell 7.3 隨附于 PSReadLine 2.2.6。” (<a target="_blank" href="https://learn.microsoft.com/zh-tw/powershell/module/psreadline/about/about_psreadline?view=powershell-7.3">Source</a>)</p>
</li>
</ul>
</li>
<li><p><a target="_blank" href="https://ohmyposh.dev/">Oh My Posh</a></p>
</li>
</ul>
<h1 id="heading-5l2c5qwt55kw5akd">作業環境</h1>
<ul>
<li><p>Windows 11 22H2 Build 22621.2283</p>
</li>
<li><p>Windows Terminal 1.17.11461.0 (已內建)</p>
</li>
<li><p>winget v1.6.2721 (已內建)</p>
<pre><code class="lang-powershell">  winget -<span class="hljs-literal">-version</span>
</code></pre>
</li>
<li><p>Windows PowerShell 5.1 (已內建)</p>
<pre><code class="lang-powershell">  <span class="hljs-variable">$PSVersionTable</span>
</code></pre>
</li>
<li><p>PowerShell 7.3.7</p>
</li>
<li><p>Oh My Posh 18.10.3</p>
<pre><code class="lang-powershell">  <span class="hljs-built_in">oh</span><span class="hljs-literal">-my</span><span class="hljs-literal">-posh</span> -<span class="hljs-literal">-version</span>
</code></pre>
</li>
</ul>
]]></content:encoded></item><item><title><![CDATA[如何查看 Windows 網路磁碟機的 IP 位址？]]></title><description><![CDATA[若要查看 Windows 網路磁碟機的資料夾位置，可以在命令提示字元或 Windows Terminal 輸入以下命令：
net use

如此即可查看網路磁碟機的 IP 位址及連接狀態等資訊。]]></description><link>https://blog.wchu.net/find-windows-network-drive-path</link><guid isPermaLink="true">https://blog.wchu.net/find-windows-network-drive-path</guid><category><![CDATA[Windows]]></category><dc:creator><![CDATA[Willy Chu]]></dc:creator><pubDate>Tue, 01 Aug 2023 12:55:22 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1738222757571/fca7e873-78c7-49e5-92e3-c1a456d64635.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>若要查看 Windows 網路磁碟機的資料夾位置，可以在命令提示字元或 <a target="_blank" href="https://www.microsoft.com/store/productid/9N0DX20HK701">Windows Terminal</a> 輸入以下命令：</p>
<pre><code class="lang-bash">net use
</code></pre>
<p>如此即可查看網路磁碟機的 IP 位址及連接狀態等資訊。</p>
]]></content:encoded></item><item><title><![CDATA[如何切換 Microsoft Forms 的語言？]]></title><description><![CDATA[Microsoft Forms 提供了便利的問卷或測驗表單，其中包含了一些 Google 表單所沒有的功能。若在使用過程中發現網站的語言不是繁體中文或您慣用的語言，可以根據本文介紹的方式進行修改。
切換 Microsoft Forms 的語言
一般來說，可以在微軟的 Microsoft 帳戶網站上進行語言調整，但若發現修改後的 Microsoft Forms 仍沒有套用對應的語言，根據微軟的說明文件，只要在網址加入 lang 的查詢字串參數（Query String Parameter），並指定...]]></description><link>https://blog.wchu.net/how-to-switch-microsoft-forms-language</link><guid isPermaLink="true">https://blog.wchu.net/how-to-switch-microsoft-forms-language</guid><category><![CDATA[Microsoft Forms]]></category><dc:creator><![CDATA[Willy Chu]]></dc:creator><pubDate>Sun, 28 May 2023 12:06:16 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1738223066957/894676f6-48fa-420a-8f88-6210fc3bf946.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><a target="_blank" href="https://forms.microsoft.com/">Microsoft Forms</a> 提供了便利的問卷或測驗表單，其中包含了一些 <a target="_blank" href="https://docs.google.com/forms/">Google 表單</a>所沒有的功能。若在使用過程中發現網站的語言不是繁體中文或您慣用的語言，可以根據本文介紹的方式進行修改。</p>
<h3 id="heading-microsoft-forms">切換 Microsoft Forms 的語言</h3>
<p>一般來說，可以在微軟的 <a target="_blank" href="https://account.microsoft.com/">Microsoft 帳戶</a>網站上進行語言調整，但若發現修改後的 Microsoft Forms 仍沒有套用對應的語言，根據<a target="_blank" href="https://support.microsoft.com/en-us/office/language-settings-for-microsoft-forms-b282f9aa-0fe4-4290-b1e1-827a8a35ac27">微軟的說明文件</a>，只要在網址加入 <code>lang</code> 的查詢字串參數（Query String Parameter），並指定<a target="_blank" href="https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-lcid/70feba9f-294e-491e-b6eb-56532684c37f">對應的語言碼</a>，即可修改 Microsoft Forms 的語言。</p>
<p>舉例來說：</p>
<ul>
<li><p>繁體中文（台灣）可以加上 <code>lang=zh-TW</code></p>
</li>
<li><p>英文可以加上 <code>lang=en</code></p>
</li>
</ul>
<h3 id="heading-5yd6icd6loh5paz">參考資料</h3>
<ul>
<li><a target="_blank" href="https://support.microsoft.com/en-us/office/language-settings-for-microsoft-forms-b282f9aa-0fe4-4290-b1e1-827a8a35ac27">Language settings for Microsoft Forms</a></li>
</ul>
]]></content:encoded></item><item><title><![CDATA[如何正確地呼叫需要傳入 string[] 引數的 ASP.NET WebService 方法？]]></title><description><![CDATA[假設我們有一個 ASP.NET WebService （.asmx）方法，這個方法需要傳入 string[] 型態的資料，其宣告如下：
[WebMethod]
public string ConcatString(string[] strArray)
{
    return string.Join(", ", strArray);
}

若我們想從其他專案中呼叫這個 WebService 方法，我們需要先加入服務參考。在此之前，我們可能會誤以為 ConcatString() 方法需要傳入 st...]]></description><link>https://blog.wchu.net/call-aspnet-webservice-method-with-string-array</link><guid isPermaLink="true">https://blog.wchu.net/call-aspnet-webservice-method-with-string-array</guid><category><![CDATA[webservice]]></category><category><![CDATA[ASP.NET]]></category><dc:creator><![CDATA[Willy Chu]]></dc:creator><pubDate>Tue, 25 Apr 2023 12:27:11 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1738222533820/2fe068dc-e547-4f30-a6ee-582c72714836.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>假設我們有一個 ASP.NET WebService （.asmx）方法，這個方法需要傳入 <code>string[]</code> 型態的資料，其宣告如下：</p>
<pre><code class="lang-csharp">[<span class="hljs-meta">WebMethod</span>]
<span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">string</span> <span class="hljs-title">ConcatString</span>(<span class="hljs-params"><span class="hljs-keyword">string</span>[] strArray</span>)</span>
{
    <span class="hljs-keyword">return</span> <span class="hljs-keyword">string</span>.Join(<span class="hljs-string">", "</span>, strArray);
}
</code></pre>
<p>若我們想從其他專案中呼叫這個 WebService 方法，我們需要先加入服務參考。在此之前，我們可能會誤以為 <code>ConcatString()</code> 方法需要傳入 <code>string[]</code>，因此可能會這樣呼叫：</p>
<pre><code class="lang-csharp"><span class="hljs-keyword">var</span> client = <span class="hljs-keyword">new</span> WebService1SoapClient();
<span class="hljs-keyword">var</span> input = <span class="hljs-keyword">new</span> <span class="hljs-keyword">string</span>[] { <span class="hljs-string">"a"</span>, <span class="hljs-string">"b"</span>, <span class="hljs-string">"c"</span> };

<span class="hljs-keyword">var</span> result = client.ConcatString(input); <span class="hljs-comment">// 錯誤寫法</span>
</code></pre>
<p>然而，這樣會導致編譯器報錯。IntelliSense 會提示我們應該傳入一個 <code>ArrayOfString</code> 型別。</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1682423635346/9a267cc8-ab75-4007-93a4-4a5d49ee9e48.png" alt class="image--center mx-auto" /></p>
<p>根據 IntelliSense 的提示，我們應該這樣修改程式碼：</p>
<pre><code class="lang-csharp"><span class="hljs-keyword">var</span> client = <span class="hljs-keyword">new</span> WebService1SoapClient();
<span class="hljs-keyword">var</span> input = <span class="hljs-keyword">new</span> <span class="hljs-keyword">string</span>[] { <span class="hljs-string">"a"</span>, <span class="hljs-string">"b"</span>, <span class="hljs-string">"c"</span> };

<span class="hljs-keyword">var</span> arrayOfString = <span class="hljs-keyword">new</span> ArrayOfString();
arrayOfString.AddRange(input);
<span class="hljs-keyword">var</span> result = client.ConcatString(arrayOfString);
</code></pre>
<p>通過上述修改，我們就能正確地呼叫需要傳入 <code>string[]</code> 引數的 ASP.NET WebService 方法。</p>
<p>參考資料：</p>
<ul>
<li><a target="_blank" href="https://stackoverflow.com/a/12995571">Passing string array to webservice method</a></li>
</ul>
]]></content:encoded></item><item><title><![CDATA[搬家到 Hashnode]]></title><description><![CDATA[這個月初透過 ChatGPT 發現了 Hashnode。
離開 Blogger 的原因
雖然 Blogger 前台的自訂性很高，但不時會擔心前台主題會被我改壞，要避免這種狀況也只能定時手動備份。此外，Blogger 的文章編輯器並未提供程式碼區塊，要加上程式碼只能透過修改文章 HTML 並透過第三方套件來加入前台的樣式。
最後，感覺 Google 近年較少在 Blogger 上推出新的功能或改進，不確定是否還為 Google 的主力產品之一。不過憑藉著 Blogger 龐大的用戶量，感覺也不太會...]]></description><link>https://blog.wchu.net/moving-to-hashnode</link><guid isPermaLink="true">https://blog.wchu.net/moving-to-hashnode</guid><category><![CDATA[Hashnode]]></category><category><![CDATA[Blogger]]></category><dc:creator><![CDATA[Willy Chu]]></dc:creator><pubDate>Mon, 17 Apr 2023 13:12:26 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1738222742260/e39dc304-5fbd-40e9-bab5-c88c1949ac85.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>這個月初透過 ChatGPT 發現了 Hashnode。</p>
<h1 id="heading-blogger">離開 Blogger 的原因</h1>
<p>雖然 Blogger 前台的自訂性很高，但不時會擔心前台主題會被我改壞，要避免這種狀況也只能定時手動備份。此外，Blogger 的文章編輯器並未提供程式碼區塊，要加上程式碼只能透過修改文章 HTML 並透過第三方套件來加入前台的樣式。</p>
<p>最後，感覺 Google 近年較少在 Blogger 上推出新的功能或改進，不確定是否還為 Google 的主力產品之一。不過憑藉著 Blogger 龐大的用戶量，感覺也不太會被加入 <a target="_blank" href="https://killedbygoogle.com/">Google 的墓園</a>，因此也沒有需要立即離開的理由。</p>
<h1 id="heading-hashnode">發現 Hashnode</h1>
<p>隨著近半年 AI 的風潮，上個月底詢問 ChatGPT 是否有推薦的「寫作友善」的落格平台，撇除了自架網站的項目外，我發現了 Hashnode 這個部落格平台。</p>
<p>在當初嘗試 Hashnode 後，其實不打算繼續使用下去，直到前幾天看到 Hashnode 推出了 <a target="_blank" href="https://hashnode.com/pro">Pro 方案</a>，加上官方有提供五折折扣碼，覺得可以給個機會試試看，畢竟有五折折扣碼嘛！😄 我也想看看 Hashnode 是否會推出更 Pro 的功能。</p>
<h1 id="heading-hashnode-1">Hashnode 的亮點</h1>
<p>對我來說，Hashnode 有一些還不錯的部分：</p>
<ul>
<li><p>好用的文章編輯器</p>
<ul>
<li><p>支援 Markdown 撰寫</p>
</li>
<li><p>可透過拖曳上傳影像</p>
</li>
<li><p>支援 AI 和 Grammarly（對使用英文撰寫較有用）（AI 為 Hashnode Pro 的功能）</p>
</li>
<li><p>可透過 Unsplash 搜尋並加入封面影像</p>
</li>
</ul>
</li>
<li><p>自訂網域操作簡易</p>
</li>
<li><p>提供匯出功能，且能自動備份至 GitHub</p>
</li>
</ul>
<p>當然有更多好用的功能，就讓各位自己去發掘吧！</p>
<h1 id="heading-hashnode-2">Hashnode 的缺點</h1>
<p>至於為什麼當初 Hashnode 並不吸引我？我整理了幾個項目：（還包含後期才發現的內容）</p>
<ul>
<li><p>文章相關：</p>
<ul>
<li><p>淺色主題下的程式碼區塊仍然是深色的版本</p>
</li>
<li><p>已發布的文章無法返回草稿狀態</p>
</li>
<li><p>無法自訂 Hashtag 大小寫（必須使用全站共用的版本）</p>
</li>
<li><p>文章編輯器未有復原及重作按鈕（在手機操作比較有影響）</p>
</li>
</ul>
</li>
<li><p>部落格相關：</p>
<ul>
<li><p>網站快取稍微強大：通常更新後，需要重新整理 2 ~ 3 次，頁面才會是最新的狀態</p>
</li>
<li><p>匯出檔內的影像只包含影像網址，而非影像本身</p>
</li>
<li><p>未提供標籤清單（標籤雲）的功能</p>
</li>
</ul>
</li>
<li><p>平台相關：</p>
<ul>
<li>即使位於同一個網域之下，Hashnode 站內很多功能連結皆是在新分頁開啟，導致瀏覽器常常出現很多分頁</li>
</ul>
</li>
</ul>
<h1 id="heading-57wq6kqe">結語</h1>
<p>整體來說，Hashnode 是一個不錯的部落格平台，儘管對我來說仍有一些可再加強的部分，但方便的文章編輯器讓我能夠輕鬆地發佈文章，在管理部落格也還算便利。</p>
]]></content:encoded></item><item><title><![CDATA[解決 FileUpload.HasFile 總是回傳 false 的問題]]></title><description><![CDATA[前陣子使用 WebForm（.aspx）的 FileUpload 上傳檔案時，後置程式碼（Code Behind）一直無法取得檔案，FileUpload.HasFile 總是回傳 false。
相關程式碼簡化如下。
首先是 .aspx 頁面：
<form id="form1" runat="server">
    <div>
        <!--表單-->
        <asp:FileUpload ID="FileUpload1" runat="server" />
        ...]]></description><link>https://blog.wchu.net/why-aspnet-fileupload-hasfile-always-returns-false</link><guid isPermaLink="true">https://blog.wchu.net/why-aspnet-fileupload-hasfile-always-returns-false</guid><category><![CDATA[ASP.NET]]></category><category><![CDATA[WebForm]]></category><category><![CDATA[.NET Framework]]></category><dc:creator><![CDATA[Willy Chu]]></dc:creator><pubDate>Thu, 19 Jan 2023 04:23:59 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1738222445403/ea9caead-7246-4bfa-8526-b12db50e8b16.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>前陣子使用 WebForm（.aspx）的 FileUpload 上傳檔案時，後置程式碼（Code Behind）一直無法取得檔案，FileUpload.HasFile 總是回傳 false。</p>
<p>相關程式碼簡化如下。</p>
<p>首先是 .aspx 頁面：</p>
<pre><code class="lang-html"><span class="hljs-tag">&lt;<span class="hljs-name">form</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"form1"</span> <span class="hljs-attr">runat</span>=<span class="hljs-string">"server"</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">div</span>&gt;</span>
        <span class="hljs-comment">&lt;!--表單--&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">asp:FileUpload</span> <span class="hljs-attr">ID</span>=<span class="hljs-string">"FileUpload1"</span> <span class="hljs-attr">runat</span>=<span class="hljs-string">"server"</span> /&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">asp:Button</span> <span class="hljs-attr">Text</span>=<span class="hljs-string">"上傳檔案"</span> <span class="hljs-attr">runat</span>=<span class="hljs-string">"server"</span> /&gt;</span>
    <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">div</span>&gt;</span>
        <span class="hljs-comment">&lt;!--結果--&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">asp:Label</span> <span class="hljs-attr">ID</span>=<span class="hljs-string">"Label1"</span> <span class="hljs-attr">runat</span>=<span class="hljs-string">"server"</span> /&gt;</span>
    <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">form</span>&gt;</span>
</code></pre>
<p>然後 .aspx.cs 頁面：</p>
<pre><code class="lang-csharp"><span class="hljs-function"><span class="hljs-keyword">protected</span> <span class="hljs-keyword">void</span> <span class="hljs-title">Page_Load</span>(<span class="hljs-params"><span class="hljs-keyword">object</span> sender, EventArgs e</span>)</span>
{
    <span class="hljs-keyword">if</span> (IsPostBack)
    {
        Label1.Text = FileUpload1.HasFile.ToString();
    }
}
</code></pre>
<p>在找了一陣子後，發現是上傳的檔案大小是 0 KB 的關係，這將會導致 FileUpload.HasFile 回傳 false。</p>
<p>另外，如果在 UpdatePanel 內使用 FileUpload，又有一些需要注意的地方。</p>
<p>參考資料：</p>
<ul>
<li><p><a target="_blank" href="https://social.msdn.microsoft.com/Forums/en-US/00445d01-0b1f-452d-8a97-7d58108c511b/fileupload-asp-control-does-not-contain-uploaded-file?forum=aspwebforms">FileUpload ASP Control does not contain uploaded file</a></p>
</li>
<li><p><a target="_blank" href="https://dotblogs.com.tw/ricochen/2010/12/23/20339">[ASP.NET][Tips]FileUpload.HasFile 屬性會檢查檔案內容</a></p>
</li>
</ul>
]]></content:encoded></item><item><title><![CDATA[將 Notion 頁面匯出成 HTML 後，部分圖片無法正常讀取的解決方式]]></title><description><![CDATA[前陣子（2022 年 3 月初）因為要將 Notion 文件匯出給同事參考，卻發現匯出的 HTML 檔案會發生破圖的問題。
狀況描述
匯出時選擇 HTML 並且包含子頁面（Include subpages），會發現匯出的檔案中，有部分的圖片無法正常讀取。
解決方式
參考 Notion 官方提供的方式，將瀏覽器快取清除後，就可以正常匯出了。（注意：可能會需要重新登入！）
操作方式
以 Google Chrome 為例，開啟開發者工具（F12），並在「重新整理」的按鈕上按下右鍵，選擇「清除快取並強制...]]></description><link>https://blog.wchu.net/fix-notion-export-html-broken-images</link><guid isPermaLink="true">https://blog.wchu.net/fix-notion-export-html-broken-images</guid><category><![CDATA[notion]]></category><dc:creator><![CDATA[Willy Chu]]></dc:creator><pubDate>Sun, 03 Jul 2022 04:22:38 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1738222158990/ad8b0139-2e2a-46e2-9ef1-7a3970eaa92b.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>前陣子（2022 年 3 月初）因為要將 Notion 文件匯出給同事參考，卻發現匯出的 HTML 檔案會發生破圖的問題。</p>
<h1 id="heading-54ua5rob5op6lw">狀況描述</h1>
<p>匯出時選擇 HTML 並且包含子頁面（Include subpages），會發現匯出的檔案中，有部分的圖片無法正常讀取。</p>
<h1 id="heading-6kej5rg65pa55byp">解決方式</h1>
<p>參考 <a target="_blank" href="https://www.notion.so/help/reset-notion">Notion 官方提供的方式</a>，將瀏覽器快取清除後，就可以正常匯出了。（注意：可能會需要重新登入！）</p>
<h1 id="heading-5pon5l2c5pa55byp">操作方式</h1>
<p>以 Google Chrome 為例，開啟開發者工具（F12），並在「重新整理」的按鈕上按下右鍵，選擇「清除快取並強制重新載入」。（Microsoft Edge 叫做「清空快取並強制重新整理」）</p>
]]></content:encoded></item><item><title><![CDATA[暫時解決惱人的 Windows 11 輸入法彈出選單]]></title><description><![CDATA[問題已暫時解決，請參考文末 2022/10/04 的補充內容

為了在程式開發 IDE 內順利使用快速鍵，平時會在電腦裡個別安裝英文與中文的輸入法，但 Windows 11 的 Alt+Shift 切換語言整個很難用，真的超煩的啦！
說明一下主要的狀況如下，在按下 Alt+Shift 切換語言後，桌面右下角的「鍵盤配置」彈出視窗有時會卡在畫面上，只要接下來要輸入的字元是鍵盤左上的 1 或 2，輸入法可能就會被更換為切換前的語言，導致輸入上的不流暢。
雖然無法完美解決問題，但目前覺得比較好的解法如...]]></description><link>https://blog.wchu.net/alternative-disable-language-switch-bar</link><guid isPermaLink="true">https://blog.wchu.net/alternative-disable-language-switch-bar</guid><category><![CDATA[Windows]]></category><dc:creator><![CDATA[Willy Chu]]></dc:creator><pubDate>Wed, 30 Mar 2022 04:21:41 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1738221873232/b449a526-63d0-43f8-b17b-6cd13c5fb44b.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1681618770378/f9b0db9a-25ce-4a86-b064-8562c5573b8a.png" alt class="image--center mx-auto" /></p>
<blockquote>
<p>問題已暫時解決，請參考文末 2022/10/04 的補充內容</p>
</blockquote>
<p>為了在程式開發 IDE 內順利使用快速鍵，平時會在電腦裡個別安裝英文與中文的輸入法，但 Windows 11 的 Alt+Shift 切換語言整個很難用，真的超煩的啦！</p>
<p>說明一下主要的狀況如下，在按下 Alt+Shift 切換語言後，桌面右下角的「鍵盤配置」彈出視窗有時會卡在畫面上，只要接下來要輸入的字元是鍵盤左上的 1 或 2，輸入法可能就會被更換為切換前的語言，導致輸入上的不流暢。</p>
<p>雖然無法完美解決問題，但目前覺得比較好的解法如下：</p>
<ol>
<li><p>使用舊版微軟注音</p>
</li>
<li><p>在 設定 的 時間與語言 &gt; 輸入 &gt; 進階鍵盤設定 中，</p>
<ul>
<li><p>將「在桌面語言列可用時使用它」勾選</p>
</li>
<li><p>點選「語言列選項」，將語言列設為隱藏，並取消勾選其餘項目</p>
</li>
</ul>
</li>
</ol>
<p>缺點是看不到目前輸入的語言是什麼，不過右下角的彈出就不會卡在畫面上了。</p>
<p>目前還沒遇到什麼問題，若後續仍有狀況會再更新～</p>
<p><strong>2022/06/01 更新：</strong></p>
<p>由於看不到目前輸入的語言還滿困擾的，近期改為以下設定，再觀察看看！</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1681618856877/a5da7654-bb48-40dc-8430-a571b307b9e4.png" alt class="image--center mx-auto" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1681618865058/1c70a005-9dd2-4cb2-bc05-beb9aa5992f8.png" alt class="image--center mx-auto" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1681618870229/d5f1939d-44ff-456d-8995-ec5d28724396.png" alt class="image--center mx-auto" /></p>
<p><strong>2022/10/14 更新：</strong></p>
<p>在更新 Windows 11 22H2 之後，發現 Alt+Shift 切換語言時不會再彈出「鍵盤配置」視窗了！ </p>
<p>另外，舊版「微軟注音」在跟「英文」切換上似乎有點問題，所以就改用新版「微軟注音」了！</p>
<p>作業環境：</p>
<ul>
<li>Windows 11 Pro 21H2</li>
</ul>
]]></content:encoded></item><item><title><![CDATA[讓 Lenovo 筆電不要自動切換 Dolby Access 的設定]]></title><description><![CDATA[最近因為有些音檔的人聲比較不清楚，所以將 Lenovo 筆電內附的 Dolby Access 的設定調整為「語音」，但只要用不同的軟體打開音檔，就會自動切換到「電影」或「音樂」，相當困擾。
最後發現 Lenovo Vantage 內有個設定是針對開啟的程式進行自動切換，只要把它關閉就解決問題啦！

作業環境：

Windows 11 Pro 21H2

Lenovo Vantage 10.2202.9.0

Dolby Access 3.12.419.0]]></description><link>https://blog.wchu.net/disable-lenovo-dolby-access-auto-optimize</link><guid isPermaLink="true">https://blog.wchu.net/disable-lenovo-dolby-access-auto-optimize</guid><category><![CDATA[lenovo]]></category><category><![CDATA[Windows]]></category><dc:creator><![CDATA[Willy Chu]]></dc:creator><pubDate>Wed, 16 Mar 2022 04:18:02 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1738221398007/dd71861b-ee96-404d-a900-8ab3b048dd63.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>最近因為有些音檔的人聲比較不清楚，所以將 Lenovo 筆電內附的 Dolby Access 的設定調整為「語音」，但只要用不同的軟體打開音檔，就會自動切換到「電影」或「音樂」，相當困擾。</p>
<p>最後發現 Lenovo Vantage 內有個設定是針對開啟的程式進行自動切換，只要把它關閉就解決問題啦！</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1681618654143/cbeb5a93-1348-41f1-8645-fec77e4ccfe1.png" alt class="image--center mx-auto" /></p>
<p>作業環境：</p>
<ul>
<li><p>Windows 11 Pro 21H2</p>
</li>
<li><p>Lenovo Vantage 10.2202.9.0</p>
</li>
<li><p>Dolby Access 3.12.419.0</p>
</li>
</ul>
]]></content:encoded></item><item><title><![CDATA[關於 Web 應用在 LINE app 的限制（Android、iOS）]]></title><description><![CDATA[最近因為開發 LINE 手機端的網頁應用，對於 LINE in-app browser 在手機雙平台（Android、iOS）中不一致的設定有些小小心得，為避免以後又踩同樣的坑，整理如下。


本文部分內容不限於 LINE in-app browser，在其他瀏覽器可能也有該狀況。

本文內容僅考慮一般網頁的狀況下，並未使用 LINE 推出的 LIFF 及其瀏覽器。




Android/iOS 雙系統

LINE in-app browser 無法使用 JavaScript 關閉視窗。

A...]]></description><link>https://blog.wchu.net/web-app-limitations-in-line-app-browser</link><guid isPermaLink="true">https://blog.wchu.net/web-app-limitations-in-line-app-browser</guid><category><![CDATA[ Line ]]></category><dc:creator><![CDATA[Willy Chu]]></dc:creator><pubDate>Sun, 08 Aug 2021 04:16:31 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1738221247044/36caa1d7-c3cf-4a9e-9947-c03e2b0b4074.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>最近因為開發 LINE 手機端的網頁應用，對於 LINE in-app browser 在手機雙平台（Android、iOS）中不一致的設定有些小小心得，為避免以後又踩同樣的坑，整理如下。</p>
<blockquote>
<ul>
<li><p>本文部分內容不限於 LINE in-app browser，在其他瀏覽器可能也有該狀況。</p>
</li>
<li><p>本文內容僅考慮一般網頁的狀況下，並未使用 LINE 推出的 LIFF 及其瀏覽器。</p>
</li>
</ul>
</blockquote>
<hr />
<p>Android/iOS 雙系統</p>
<ul>
<li>LINE in-app browser 無法使用 JavaScript 關閉視窗。</li>
</ul>
<p>Android 系統</p>
<ul>
<li><p>關於上傳/下載檔案：</p>
<ul>
<li><p>在 LINE in-app browser 下，file 類型的 input 標籤內不可包含 <a target="_blank" href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#accept">accept</a> 屬性，否則會發生無法選取檔案的狀況。</p>
</li>
<li><p>在 LINE in-app browser 透過 file 類型的 input 標籤選取多個檔案時，似乎是 LINE in-app browser 的限制導致無法多選檔案，也就是說，每次僅能選取一個檔案。（若要一次上傳多個檔案，就要實作 append 的檔案選取方式，請使用者分次選取多個檔案）</p>
</li>
<li><p>透過 file 類型的 input 標籤選取待上傳的檔案時，若在 Android 檔案管理器選擇雲端空間（例如：Google Drive、OneDrive等等）的檔案後，可能會發生無法上傳的問題。 （似乎所有瀏覽器都有此狀況，而不限於 LINE in-app browser）</p>
</li>
<li><p>若有安裝 ES 檔案瀏覽器，在 LINE in-app browser 下載檔案可能會失敗。</p>
</li>
</ul>
</li>
<li><p>若要讓 LINE 的使用者點擊連結後強制使用外部瀏覽器開啟，可以在網址後方加上「openExternalBrowser=1 」的 Query String 參數。（大小寫有區分！）</p>
</li>
</ul>
<p>iOS 系統</p>
<ul>
<li><p>關於上傳/下載檔案：</p>
<ul>
<li>通常要觸發下載檔案的 dialog，可在回應的 header 加入「<a target="_blank" href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition">Content-Disposition: attachment</a>」，但在 iOS 上似乎只有 Safari 支援下載檔案的 dialog，其餘的瀏覽器（包含 LINE 內建瀏覽器）都會直接在網頁中開啟檔案。</li>
</ul>
</li>
<li><p>若要讓 LINE 的使用者點擊連結後強制使用外部瀏覽器開啟，可以在網址後方加上「openExternalBrowser=1 」的 Query String 參數。（大小寫未區分！）</p>
</li>
</ul>
<hr />
<p>作業環境：</p>
<ul>
<li><p>LINE 版本 11.12.1</p>
</li>
<li><p>iOS 版本 14.7.1</p>
</li>
<li><p>Android 版本 9、10</p>
</li>
</ul>
]]></content:encoded></item><item><title><![CDATA[讓 Visual Studio 建置專案時，不要彈出輸出視窗]]></title><description><![CDATA[當我們在 Visual Studio 中建置程式時，預設的設定會讓「輸出」視窗彈出，並顯示建置過程的詳細資訊。
然而，這個彈出視窗的行為可能會打斷我們的思緒，並使得整個介面看起來較為雜亂。因此，我們可能更傾向於在需要查看輸出訊息時，再手動開啟「輸出」視窗。
如果你也有相同的困擾，可以透過調整 Visual Studio 的設定來停止「輸出」視窗自動彈出的行為。具體的操作步驟如下：

工具 → 選項

專案和方案 → 一般

將「建置開始時顯示輸出視窗」取消勾選


透過以上的設定，你就可以在建置...]]></description><link>https://blog.wchu.net/visual-studio-output-window</link><guid isPermaLink="true">https://blog.wchu.net/visual-studio-output-window</guid><category><![CDATA[visual studio]]></category><dc:creator><![CDATA[Willy Chu]]></dc:creator><pubDate>Mon, 05 Jul 2021 04:14:04 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1738220894615/facf6120-6a19-4b64-988a-c1e928c7e308.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>當我們在 Visual Studio 中建置程式時，預設的設定會讓「輸出」視窗彈出，並顯示建置過程的詳細資訊。</p>
<p>然而，這個彈出視窗的行為可能會打斷我們的思緒，並使得整個介面看起來較為雜亂。因此，我們可能更傾向於在需要查看輸出訊息時，再手動開啟「輸出」視窗。</p>
<p>如果你也有相同的困擾，可以透過調整 Visual Studio 的設定來停止「輸出」視窗自動彈出的行為。具體的操作步驟如下：</p>
<ol>
<li><p>工具 → 選項</p>
</li>
<li><p>專案和方案 → 一般</p>
</li>
<li><p>將「建置開始時顯示輸出視窗」取消勾選</p>
</li>
</ol>
<p>透過以上的設定，你就可以在建置程式時，保持你的工作環境整潔，並專注在程式碼的撰寫上了。</p>
<hr />
<p>參考資料：</p>
<ul>
<li><a target="_blank" href="https://stackoverflow.com/a/44947876/2866545">How to keep output window always open in Visual Studio 2017</a></li>
</ul>
]]></content:encoded></item><item><title><![CDATA[記錄在 WSL 2 使用 Docker 安裝 SQL Server for Linux 的過程]]></title><description><![CDATA[以下是自己參照網路上文章實際操作的記錄，僅供參考。（使用的軟體環境附於文末）

在控制台的「開啟或關閉 Windows 功能」開啟下列 2 個選項：

Windows 子系統 Linux 版

虛擬機器平台


系統會請你重新啟動電腦。

重新啟動後，到 Microsoft Store 選擇欲安裝 Linux 發行版本，此次選擇安裝 Ubuntu 18.04。
將 Ubuntu 18.04 安裝完成後，第一次啟動會提示設定使用者帳戶及密碼名稱，設定完成後就可先關閉。（只有第一次啟動會比較久，之後...]]></description><link>https://blog.wchu.net/install-sql-server-for-linux-using-docker-in-wsl2</link><guid isPermaLink="true">https://blog.wchu.net/install-sql-server-for-linux-using-docker-in-wsl2</guid><category><![CDATA[Docker]]></category><category><![CDATA[SQL Server]]></category><category><![CDATA[WSL]]></category><dc:creator><![CDATA[Willy Chu]]></dc:creator><pubDate>Sat, 04 Jul 2020 16:44:12 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1738220269550/b7e938ba-b8af-4e71-8299-6e9075cbcb6d.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>以下是自己參照網路上文章實際操作的記錄，僅供參考。（使用的軟體環境附於文末）</p>
<hr />
<p>在控制台的「開啟或關閉 Windows 功能」開啟下列 2 個選項：</p>
<ul>
<li><p>Windows 子系統 Linux 版</p>
</li>
<li><p>虛擬機器平台</p>
</li>
</ul>
<p>系統會請你重新啟動電腦。</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1681576100246/33b8c4ad-1381-4d4b-a6f5-2b43029dd215.png" alt class="image--center mx-auto" /></p>
<p>重新啟動後，到 Microsoft Store 選擇欲安裝 Linux 發行版本，此次選擇安裝 <a target="_blank" href="https://www.microsoft.com/zh-tw/p/ubuntu-1804-lts/9n9tngvndl3q">Ubuntu 18.04</a>。</p>
<p>將 Ubuntu 18.04 安裝完成後，第一次啟動會提示設定使用者帳戶及密碼名稱，設定完成後就可先關閉。（只有第一次啟動會比較久，之後通常都會是秒開。）</p>
<p>接著，在命令提示字元輸入以下指令查看剛剛安裝的 Ubuntu 有沒有出現，此時命令提示字元上的對應 VERSION 應該為 1，代表使用 WSL 1。</p>
<pre><code class="lang-bash">wsl -l -v
</code></pre>
<p>接著我們要將 WSL 的版本設定為 2，請在命令提示字元輸入以下指令來設定 Ubuntu 的 WSL 版本。</p>
<blockquote>
<p>此時可能會提示<a target="_blank" href="https://docs.microsoft.com/zh-tw/windows/wsl/wsl2-kernel">更新 Linux 核心</a>，更新完成後請再次執行指令。</p>
</blockquote>
<pre><code class="lang-bash">wsl --set-version Ubuntu-18.04 2
</code></pre>
<p>待前述動作完成後，此時 <code>wsl -l -v</code> 顯示的 VERSION 就會為 2 了。</p>
<hr />
<p>在 Windows 10 上安裝 <a target="_blank" href="https://hub.docker.com/editions/community/docker-ce-desktop-windows/">Docker Desktop for Windows</a>，安裝完成會提示重新登入 Windows。</p>
<p>重新登入後，在 Docker Desktop 的選項中確認下列選項已開啟：</p>
<ul>
<li><p>General → Use the WSL 2 based engine</p>
</li>
<li><p>Resources → WSL INTEGRATION → Ubuntu 18.04</p>
</li>
</ul>
<p>記得按下右下角的 Apply &amp; Restart 儲存。</p>
<p>將剛剛安裝的 Ubuntu 18.04 打開，並輸入以下指定下載最新版的 <a target="_blank" href="https://hub.docker.com/_/microsoft-mssql-server">SQL Server 的 Image</a>。</p>
<pre><code class="lang-bash">docker pull mcr.microsoft.com/mssql/server:2019-latest
</code></pre>
<p>接著輸入下列指令來建立容器。</p>
<pre><code class="lang-bash">docker run -e <span class="hljs-string">"ACCEPT_EULA=Y"</span> -e <span class="hljs-string">"MSSQL_SA_PASSWORD=&lt;SQL Server連接密碼&gt;"</span> -p 1433:1433 --name &lt;自訂容器名稱&gt; -d mcr.microsoft.com/mssql/server:2019-latest
</code></pre>
<p>執行完成後，可用 <code>docker ps</code> 列出容器資訊，查看 STATUS 是否為 Up 開頭，若是則代表有在執行，到此就完成 SQL Server for Linux 的安裝啦！</p>
<hr />
<p>如果要使用 SSMS 連線，因為是安裝在同一台電腦上，伺服器名稱請輸入 localhost,1433，然後使用 sa 與剛剛設定的密碼進行連線。</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1681576554195/c99d1b95-e79a-42ea-8d5a-25ea3caaf9ef.png" alt class="image--center mx-auto" /></p>
<blockquote>
<p>若按下連線後遇到下圖「與伺服器的連接已成功建立，但在登入前的信號交換時發生錯誤」，可能的解法是透過右下角「選項」按鈕展開「連接屬性」頁籤，將「加密連接」取消勾選，應可排除問題。</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1681576580969/147121ac-673e-4801-98fd-b9ab08acc1a7.png" alt class="image--center mx-auto" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1681576612107/b35ec8cd-c8b3-4758-a038-a9a85b93b36e.png" alt class="image--center mx-auto" /></p>
</blockquote>
<p>如要更詳細的說明，請參考下方連結。</p>
<p>參考資料：</p>
<ul>
<li><p><a target="_blank" href="https://docs.microsoft.com/zh-tw/windows/wsl/install-win10">Windows 10 上適用於 Linux 的 Windows 子系統安裝指南</a></p>
</li>
<li><p><a target="_blank" href="https://docs.docker.com/docker-for-windows/wsl/">Docker Desktop WSL 2 backend</a></p>
</li>
<li><p><a target="_blank" href="https://docs.microsoft.com/zh-tw/sql/linux/sql-server-linux-manage-ssms?view=sql-server-ver15">使用 Windows 上的 SQL Server Management Studio 來管理 Linux 上的 SQL Server</a></p>
</li>
<li><p><a target="_blank" href="https://docs.microsoft.com/zh-tw/sql/linux/quickstart-install-connect-docker">快速入門：使用 Docker 執行 SQL Server 容器映像</a></p>
</li>
<li><p><a target="_blank" href="https://blog.kkbruce.net/2017/12/ms-sql-server-for-linux.html#.XwCiXygzaUl">一次就愛上MS SQL SERVER FOR LINUX</a></p>
</li>
<li><p><a target="_blank" href="https://mileslin.github.io/2019/04/SQL-Server-Container-%E5%BF%AB%E9%80%9F%E5%85%A5%E9%96%80/">[Docker] SQL Server Container 快速入門</a></p>
</li>
<li><p><a target="_blank" href="https://titangene.github.io/article/docker-mssql-server-for-linux.html">在 Docker 下建立並使用 MSSQL Server for Linux</a></p>
</li>
<li><p><a target="_blank" href="https://github.com/microsoft/mssql-docker/issues/478#issuecomment-624337830">SSMS 連接問題討論串</a></p>
</li>
</ul>
<p>作業環境：</p>
<ul>
<li><p>Windows 10 (64-bit) 2004 版本</p>
</li>
<li><p>SQL Server Management Studio 18.5.1</p>
</li>
<li><p>Docker Desktop for Windows 2.3.0.3</p>
</li>
<li><p>Ubuntu 18.04 LTS (Microsoft Store app)</p>
</li>
</ul>
]]></content:encoded></item></channel></rss>