

<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>VisualStudio筆記 &#8211; Max的程式語言筆記</title>
	<atom:link href="https://stackoverflow.max-everyday.com/category/vs/feed/" rel="self" type="application/rss+xml" />
	<link>https://stackoverflow.max-everyday.com</link>
	<description>我要當一個豬頭，快樂過每一天</description>
	<lastBuildDate>Tue, 11 Nov 2025 05:21:38 +0000</lastBuildDate>
	<language>zh-TW</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.1</generator>

<image>
	<url>https://stackoverflow.max-everyday.com/wp-content/uploads/2017/02/max-stackoverflow-256.png</url>
	<title>VisualStudio筆記 &#8211; Max的程式語言筆記</title>
	<link>https://stackoverflow.max-everyday.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>vscode 的  terminal 執行 gemini 指令返回 UnauthorizedAccess</title>
		<link>https://stackoverflow.max-everyday.com/2025/11/vscode-terminal-gemini-unauthorizedaccess/</link>
					<comments>https://stackoverflow.max-everyday.com/2025/11/vscode-terminal-gemini-unauthorizedaccess/#respond</comments>
		
		<dc:creator><![CDATA[max-stackoverflow]]></dc:creator>
		<pubDate>Tue, 11 Nov 2025 05:21:37 +0000</pubDate>
				<category><![CDATA[VisualStudio筆記]]></category>
		<category><![CDATA[Windows]]></category>
		<guid isPermaLink="false">https://stackoverflow.max-everyday.com/?p=7202</guid>

					<description><![CDATA[C:\Max> gemini gemini : ...]]></description>
										<content:encoded><![CDATA[
<p>C:\Max> gemini</p>



<p>gemini : 因為這個系統上已停用指令碼執行，所以無法載入 C:\Users\max32\AppData\Roaming\npm\gemini.ps1 檔案。如需詳細資訊，請參閱 about_Execution_Policies，網址為 https:/go.microsoft.com/fwlink/?LinkID=135170。</p>



<p>位於 線路:1 字元:1</p>



<ul class="wp-block-list">
<li>gemini
<ul class="wp-block-list">
<li>CategoryInfo : SecurityError: (:) [], PSSecurityException</li>



<li>FullyQualifiedErrorId : UnauthorizedAccess</li>
</ul>
</li>
</ul>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<p>PowerShell 安全設定（Execution Policy）阻止了 <code>gemini.ps1</code> 這個腳本的執行。這是 Windows 為了防止惡意腳本執行而採取的預設安全措施。</p>



<h3 class="wp-block-heading">更改執行原則</h3>



<p>您可以將原則更改為 <strong>RemoteSigned</strong>。這是最常用的設定，它允許您自己建立的腳本執行，但要求從網路上或電子郵件下載的腳本必須有可靠的數位簽章。</p>



<p>在管理員 PowerShell 視窗中，執行以下指令：</p>



<p>PowerShell</p>



<pre class="wp-block-code"><code>Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
</code></pre>



<ul class="wp-block-list">
<li><strong><code>RemoteSigned</code></strong>: 這是推薦的安全級別。</li>



<li><strong><code>-Scope CurrentUser</code></strong>: 這只會更改您當前使用者的設定，不會影響系統上的其他使用者（更安全）。</li>
</ul>



<p><strong>額外說明：</strong> 如果您希望將執行原則改回最嚴格的狀態（不允許任何腳本執行），可以使用以下指令：</p>



<p>PowerShell</p>



<pre class="wp-block-code"><code>Set-ExecutionPolicy Restricted -Scope CurrentUser</code></pre>
]]></content:encoded>
					
					<wfw:commentRss>https://stackoverflow.max-everyday.com/2025/11/vscode-terminal-gemini-unauthorizedaccess/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to pass credentials during writing file at server path?</title>
		<link>https://stackoverflow.max-everyday.com/2018/02/how-to-pass-credentials-during-writing-file-at-server-path/</link>
					<comments>https://stackoverflow.max-everyday.com/2018/02/how-to-pass-credentials-during-writing-file-at-server-path/#respond</comments>
		
		<dc:creator><![CDATA[max-stackoverflow]]></dc:creator>
		<pubDate>Mon, 05 Feb 2018 07:51:41 +0000</pubDate>
				<category><![CDATA[VisualStudio筆記]]></category>
		<category><![CDATA[C#]]></category>
		<guid isPermaLink="false">http://stackoverflow.max-everyday.com/?p=2040</guid>

					<description><![CDATA[要先設定 web.config 開啟 &#60;i...]]></description>
										<content:encoded><![CDATA[<p>要先設定 web.config 開啟</p>
<p>&lt;identity impersonate=&#8221;true&#8221; /&gt;</p>
<p>&nbsp;</p>
<p>再設定 Enable Run As User to Act as the Operating System<br />
<a href="https://stackoverflow.max-everyday.com/2018/02/enable-run-as-user-to-act-as-the-operating-system/">https://stackoverflow.max-everyday.com/2018/02/enable-run-as-user-to-act-as-the-operating-system/</a></p>
<p>&nbsp;</p>
<p>再開啟相關的權限給 Run As User 帳號。</p>
<p>&nbsp;</p>
<p>主程式範例：<br />
<a href="https://support.microsoft.com/en-us/help/306158/how-to-implement-impersonation-in-an-asp-net-application">https://support.microsoft.com/en-us/help/306158/how-to-implement-impersonation-in-an-asp-net-application</a></p>
<pre class=""><code class="">&lt;%@ Page Language="C#"%&gt;
&lt;%@ Import Namespace = "System.Web" %&gt;
&lt;%@ Import Namespace = "System.Web.Security" %&gt;
&lt;%@ Import Namespace = "System.Security.Principal" %&gt;
&lt;%@ Import Namespace = "System.Runtime.InteropServices" %&gt;

&lt;script runat=server&gt;
public const int LOGON32_LOGON_INTERACTIVE = 2;
public const int LOGON32_PROVIDER_DEFAULT = 0;

WindowsImpersonationContext impersonationContext; 

[DllImport("advapi32.dll")]
public static extern int LogonUserA(String lpszUserName, 
String lpszDomain,
String lpszPassword,
int dwLogonType, 
int dwLogonProvider,
ref IntPtr phToken);
[DllImport("advapi32.dll", CharSet=CharSet.Auto, SetLastError=true)]
public static extern int DuplicateToken(IntPtr hToken, 
int impersonationLevel,  
ref IntPtr hNewToken);
                          
[DllImport("advapi32.dll", CharSet=CharSet.Auto, SetLastError=true)]
public static extern bool RevertToSelf();

[DllImport("kernel32.dll", CharSet=CharSet.Auto)]
public static extern  bool CloseHandle(IntPtr handle);

public void Page_Load(Object s, EventArgs e)
{
if(impersonateValidUser("username", "domain", "password"))
{
//Insert your code that runs under the security context of a specific user here.
undoImpersonation();
}
else
{
//Your impersonation failed. Therefore, include a fail-safe mechanism here.
}
}

private bool impersonateValidUser(String userName, String domain, String password)
{
WindowsIdentity tempWindowsIdentity;
IntPtr token = IntPtr.Zero;
IntPtr tokenDuplicate = IntPtr.Zero;

if(RevertToSelf())
{
if(LogonUserA(userName, domain, password, LOGON32_LOGON_INTERACTIVE, 
LOGON32_PROVIDER_DEFAULT, ref token) != 0)
{
if(DuplicateToken(token, 2, ref tokenDuplicate) != 0) 
{
tempWindowsIdentity = new WindowsIdentity(tokenDuplicate);
impersonationContext = tempWindowsIdentity.Impersonate();
if (impersonationContext != null)
{
CloseHandle(token);
CloseHandle(tokenDuplicate);
return true;
}
}
} 
}
if(token!= IntPtr.Zero)
CloseHandle(token);
if(tokenDuplicate!=IntPtr.Zero)
CloseHandle(tokenDuplicate);
return false;
}

private void undoImpersonation()
{
impersonationContext.Undo();
}
&lt;/script&gt;</code></pre>
]]></content:encoded>
					
					<wfw:commentRss>https://stackoverflow.max-everyday.com/2018/02/how-to-pass-credentials-during-writing-file-at-server-path/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Enable Run As User to Act as the Operating System</title>
		<link>https://stackoverflow.max-everyday.com/2018/02/enable-run-as-user-to-act-as-the-operating-system/</link>
					<comments>https://stackoverflow.max-everyday.com/2018/02/enable-run-as-user-to-act-as-the-operating-system/#respond</comments>
		
		<dc:creator><![CDATA[max-stackoverflow]]></dc:creator>
		<pubDate>Mon, 05 Feb 2018 07:36:34 +0000</pubDate>
				<category><![CDATA[VisualStudio筆記]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[IIS]]></category>
		<category><![CDATA[Windows]]></category>
		<guid isPermaLink="false">http://stackoverflow.max-everyday.com/?p=2033</guid>

					<description><![CDATA[To use Kerberos delegati...]]></description>
										<content:encoded><![CDATA[<p>To use Kerberos delegation with Tableau Server, you must configure the Run As User account to act as the operating system on each Tableau Server node.</p>
<ol>
<li value="1">On the computer that is running Tableau Server, select <span class="uicontrol">Start &gt; Control Panel &gt; Administrative Tools &gt; Local Security Policy</span>.</li>
<li value="2">In the Local Security Settings window, expand <span class="uicontrol">Local Policies</span>, click <span class="uicontrol">User Rights Assignments</span>, and then right-click <span class="uicontrol">Act as part of the operating system</span> and select <span class="uicontrol">Properties</span>.
<p><img fetchpriority="high" decoding="async" class="alignnone size-full wp-image-2036" src="https://stackoverflow.max-everyday.com/wp-content/uploads/2018/02/runas_os.png" alt="" width="623" height="542" srcset="https://stackoverflow.max-everyday.com/wp-content/uploads/2018/02/runas_os.png 623w, https://stackoverflow.max-everyday.com/wp-content/uploads/2018/02/runas_os-600x522.png 600w" sizes="(max-width: 623px) 100vw, 623px" /></li>
<li value="3">In the Act as part of the operating system Properties window, click <span class="uicontrol">Add User or Group</span>.</li>
<li value="4">Type the <code>&lt;domain&gt;\&lt;username&gt;</code> for the Tableau Server Run As User account (for example: <code>MYCOMPANY\tableau_server</code>), and then click <span class="uicontrol">Check Names</span>.</li>
<li value="5">When the account resolves correctly, it is underlined. Click <span class="uicontrol">OK</span>.</li>
<li value="6">Click <span class="uicontrol">OK</span> to close the Local Security Policy windows.</li>
</ol>
<p>&nbsp;</p>
<p>照上面的流程，可以讓 asp.net 提升權限為其他帳號，預設完全沒去修改的情況下，帳號是使用：</p>
<p class="p1"><span class="s1">IIS APPPOOL\DefaultAppPool</span></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<hr />
<h1 class="title">建立本機使用者帳戶</h1>
<p>更新日期: 2012年3月</p>
<p>適用於: Windows 7, Windows Server 2008, Windows Server 2008 R2, Windows Server 2012</p>
<div id="mainSection">
<div id="mainBody">
<p>若要完成此程序，至少需要 <strong>Administrators</strong> 群組成員資格。請檢視本主題中「其他考量」的詳細資料。</p>
<div id="sectionSection0" class="section">
<h4 class="subHeading">建立本機使用者帳戶</h4>
<div class="subSection">
<ol class="ordered">
<li>開啟 [電腦管理]。</li>
<li>在主控台樹狀目錄中，按一下 [使用者]。
<p><strong>位置</strong></p>
<ul>
<li class="unordered">電腦管理\系統工具\本機使用者和群組\使用者</li>
</ul>
</li>
<li>在 [執行] 功能表，按一下 [新增使用者]。</li>
<li>在對話方塊中輸入適當資訊。</li>
<li>選取或清除下列項目的核取方塊：
<ul>
<li class="unordered"><strong>使用者必須在下次登入時變更密碼</strong></li>
<li class="unordered"><strong>使用者不能變更密碼</strong></li>
<li class="unordered"><strong>密碼永久有效</strong></li>
<li class="unordered"><strong>帳戶已停用</strong></li>
</ul>
</li>
<li>按一下 [建立]，然後按 [關閉]。</li>
</ol>
</div>
<div class="subSection">
<h4 class="subHeading">其他考量</h4>
<div class="subSection">
<ul>
<li class="unordered">若要執行此程序，您必須提供本機電腦上 Administrator 帳戶的認證 (如果系統提示您)，或者您必須是本機電腦上 Administrators 群組的成員。</li>
<li class="unordered">使用者名稱不能與受管理電腦上的其他任何使用者名稱或群組名稱相同。使用者名稱最多可以包含 20 個大小寫字元，但不包括下列字元：
<p>&#8221; / \ [ ] : ; | = , + * ?&lt; &gt; @</p>
<p>群組名稱不能僅由句點 (.) 或空格所組成。</li>
<li class="unordered">在 [密碼] 及 [確認密碼] 中，您可以輸入包含多達 127 個字元的密碼。</li>
<li class="unordered">使用強式密碼及適當的密碼原則可協助保護電腦免受攻擊。</li>
</ul>
</div>
</div>
</div>
</div>
</div>
]]></content:encoded>
					
					<wfw:commentRss>https://stackoverflow.max-everyday.com/2018/02/enable-run-as-user-to-act-as-the-operating-system/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>C# program that demonstrates File.Copy exceptions</title>
		<link>https://stackoverflow.max-everyday.com/2018/02/c-program-that-demonstrates-file-copy-exceptions/</link>
					<comments>https://stackoverflow.max-everyday.com/2018/02/c-program-that-demonstrates-file-copy-exceptions/#respond</comments>
		
		<dc:creator><![CDATA[max-stackoverflow]]></dc:creator>
		<pubDate>Mon, 05 Feb 2018 07:30:46 +0000</pubDate>
				<category><![CDATA[VisualStudio筆記]]></category>
		<category><![CDATA[C#]]></category>
		<guid isPermaLink="false">http://stackoverflow.max-everyday.com/?p=2034</guid>

					<description><![CDATA[這個範例，分享2個重點，一是 c# 如何 cop...]]></description>
										<content:encoded><![CDATA[<p>這個範例，分享2個重點，一是 c# 如何 copy file, 二是 try catch 的使用，取得實際錯誤的訊息：</p>
<pre>
using System;
using System.IO;

class Program
{
    static void Main()
    {<i>
        // Copying a file that doesn't exist:
        </i>try
        {
            <u>File.Copy</u>("file-missing.txt", "file-new.txt");
        }
        catch (Exception ex)
        {
            Console.WriteLine(ex);<i>
            // System.IO.FileNotFoundException: Could not find file 'file-missing.txt'.
        </i>}<i>

        // Copying to a file without overwrite
        </i>try
        {
            <u>File.Copy</u>("file-a.txt", "file-b.txt");
        }
        catch (Exception ex)
        {
            Console.WriteLine(ex);<i>
            // System.IO.IOException: The file 'file-b.txt' already exists.
        </i>}
    }
}</pre>
]]></content:encoded>
					
					<wfw:commentRss>https://stackoverflow.max-everyday.com/2018/02/c-program-that-demonstrates-file-copy-exceptions/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Impersonate tag in Web.Config in ASP.NET</title>
		<link>https://stackoverflow.max-everyday.com/2018/02/impersonate-tag-in-web-config-in-asp-net/</link>
					<comments>https://stackoverflow.max-everyday.com/2018/02/impersonate-tag-in-web-config-in-asp-net/#respond</comments>
		
		<dc:creator><![CDATA[max-stackoverflow]]></dc:creator>
		<pubDate>Mon, 05 Feb 2018 03:24:55 +0000</pubDate>
				<category><![CDATA[VisualStudio筆記]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[IIS]]></category>
		<category><![CDATA[Windows]]></category>
		<guid isPermaLink="false">http://stackoverflow.max-everyday.com/?p=2031</guid>

					<description><![CDATA[MS 官方寫法： https://support...]]></description>
										<content:encoded><![CDATA[<p>MS 官方寫法：</p>
<p><a href="https://support.microsoft.com/en-us/help/306158/how-to-implement-impersonation-in-an-asp-net-application">https://support.microsoft.com/en-us/help/306158/how-to-implement-impersonation-in-an-asp-net-application</a></p>
<p>MS 寫的不太貼心：</p>
<h3 class="sbody-h3">Impersonate the IIS Authenticated Account or User</h3>
<p>To impersonate the Microsoft Internet Information Services (IIS) authenticating user on every request for every page in an ASP.NET application, you must include an <span class="text-base">&lt;identity&gt;</span> tag in the Web.config file of this application and set the <span class="text-base">impersonate</span> attribute to <span class="text-base">true</span>. For example:</p>
<div class="sbody-code">
<pre class=""><code>&lt;identity impersonate="true" /&gt;
</code></pre>
</div>
<p><a class="managed-link content-anchor-link" tabindex="0" href="https://support.microsoft.com/#top" target="" data-bi-name="content-anchor-link" aria-live="rude">back to the top</a></p>
<h3 class="sbody-h3"><a id="2" class="bookmark"></a>Impersonate a Specific User for All the Requests of an ASP.NET Application</h3>
<p>To impersonate a specific user for all the requests on all pages of an ASP.NET application, you can specify the <span class="text-base">userName</span> and <span class="text-base">password</span> attributes in the <span class="text-base">&lt;identity&gt;</span> tag of the Web.config file for that application. For example:</p>
<div class="sbody-code">
<pre><code>&lt;identity impersonate="true" userName="accountname" password="password" /&gt;
</code></pre>
</div>
<p><span class="text-base">Note</span> The identity of the process that impersonates a specific user on a thread must have the &#8220;Act as part of the operating system&#8221; privilege. By default, the Aspnet_wp.exe process runs under a computer account named ASPNET. However, this account does not have the required privileges to impersonate a specific user. You receive an error message if you try to impersonate a specific user. This information applies only to the .NET Framework 1.0. This privilege is not required for the .NET Framework 1.1.</p>
<p>To work around this problem, use one of the following methods:</p>
<ul class="sbody-free_list">
<li>Grant the &#8220;Act as part of the operating system&#8221; privilege to the ASPNET account (the least privileged account).<span class="text-base">Note</span> Although you can use this method to work around the problem, Microsoft does not recommend this method.</li>
<li class="">Change the account that the Aspnet_wp.exe process runs under to the System account in the &lt;processModel&gt; configuration section of the Machine.config file.</li>
</ul>
<hr />
<p>正確用法：</p>
<p>The <code>identity</code> section goes under the <code>system.web</code> section:</p>
<pre class="default prettyprint prettyprinted"><code><span class="tag">&lt;system.web&gt;</span>
  <span class="tag">&lt;authentication</span> <span class="atn">mode</span><span class="pun">=</span><span class="atv">"Windows"</span><span class="tag">/&gt;</span>
  <span class="tag">&lt;identity</span> <span class="atn">impersonate</span><span class="pun">=</span><span class="atv">"true"</span> <span class="atn">userName</span><span class="pun">=</span><span class="atv">"foo"</span> <span class="atn">password</span><span class="pun">=</span><span class="atv">"bar"</span><span class="tag">/&gt;</span>
<span class="tag">&lt;/system.web&gt;</span></code></pre>
<hr />
<h4>相關文章：</h4>
<p>Enable Run As User to Act as the Operating System<br />
<a href="https://stackoverflow.max-everyday.com/2018/02/enable-run-as-user-to-act-as-the-operating-system/">https://stackoverflow.max-everyday.com/2018/02/enable-run-as-user-to-act-as-the-operating-system/</a></p>
<p>&nbsp;</p>
<p>附註：在impersonate為其他帳號時，需要開啟 asp.net 的 temp folder 的寫入權限給該 user account, 不然會產生錯誤訊息。</p>
<p>&nbsp;</p>
<p>附註： 如果遇到這一個 Exception 在 copy file 時：</p>
<blockquote><p>System.IO.IOException: The user name or password is incorrect.</p>
<p>at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)<br />
at System.IO.File.InternalCopy(String sourceFileName, String destFileName, Boolean overwrite, Boolean checkHost)</p></blockquote>
<p>請檢查 impersonate 相關的帳號/密碼設定，或寫法是否正確。</p>
<p>&nbsp;</p>
]]></content:encoded>
					
					<wfw:commentRss>https://stackoverflow.max-everyday.com/2018/02/impersonate-tag-in-web-config-in-asp-net/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>c# The type or namespace name &#8216;DllImport&#8217; could not be found</title>
		<link>https://stackoverflow.max-everyday.com/2018/02/c-the-type-or-namespace-name-dllimport-could-not-be-found/</link>
					<comments>https://stackoverflow.max-everyday.com/2018/02/c-the-type-or-namespace-name-dllimport-could-not-be-found/#respond</comments>
		
		<dc:creator><![CDATA[max-stackoverflow]]></dc:creator>
		<pubDate>Mon, 05 Feb 2018 02:22:45 +0000</pubDate>
				<category><![CDATA[VisualStudio筆記]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Windows]]></category>
		<guid isPermaLink="false">http://stackoverflow.max-everyday.com/?p=2028</guid>

					<description><![CDATA[在 c# 裡存取系統 dll 檔案時，遇到傳回錯...]]></description>
										<content:encoded><![CDATA[<p>在 c# 裡存取系統 dll 檔案時，遇到傳回錯誤訊息：</p>
<blockquote><p>The type or namespace name &#8216;DllImport&#8217; could not be found</p></blockquote>
<hr />
<p>範例程式：</p>
<pre class="lang-cs prettyprint prettyprinted"><code><span class="pln">using </span><span class="typ">System</span><span class="pun">;</span><span class="pln">
using </span><span class="typ">System</span><span class="pun">.</span><span class="typ">Collections</span><span class="pun">.</span><span class="typ">Generic</span><span class="pun">;</span><span class="pln">
using </span><span class="typ">System</span><span class="pun">.</span><span class="typ">Linq</span><span class="pun">;</span><span class="pln">
using </span><span class="typ">System</span><span class="pun">.</span><span class="typ">Runtime</span><span class="pun">.</span><span class="typ">InteropServices</span><span class="pun">;</span><span class="pln">
using </span><span class="typ">System</span><span class="pun">.</span><span class="typ">Web</span><span class="pun">;</span><span class="pln">
using </span><span class="typ">System</span><span class="pun">.</span><span class="typ">Web</span><span class="pun">.</span><span class="pln">UI</span><span class="pun">;</span><span class="pln">
using </span><span class="typ">System</span><span class="pun">.</span><span class="typ">Web</span><span class="pun">.</span><span class="pln">UI</span><span class="pun">.</span><span class="typ">WebControls</span><span class="pun">;</span><span class="pln">
using </span><span class="typ">MapsApp</span><span class="pun">.</span><span class="pln">DB</span><span class="pun">;</span><span class="pln">

namespace </span><span class="typ">MapsApp</span>
<span class="pun">{</span>
    <span class="kwd">public</span> <span class="kwd">partial</span> <span class="kwd">class</span> <span class="typ">_Default</span> <span class="pun">:</span> <span class="typ">System</span><span class="pun">.</span><span class="typ">Web</span><span class="pun">.</span><span class="pln">UI</span><span class="pun">.</span><span class="typ">Page</span>
    <span class="pun">{</span>
        <span class="pun">[</span><span class="typ">DllImport</span><span class="pun">(</span><span class="str">"GeoUrbanApp.exe"</span><span class="pun">)]</span>
        <span class="kwd">public</span> <span class="kwd">static</span> <span class="kwd">extern</span> <span class="kwd">double</span> <span class="typ">CalcFigure</span><span class="pun">(</span><span class="kwd">double</span><span class="pln"> east</span><span class="pun">,</span> <span class="kwd">double</span><span class="pln"> north</span><span class="pun">,</span> <span class="kwd">double</span><span class="pln"> size</span><span class="pun">);</span>
<span class="pun">...</span></code></pre>
<hr />
<p>說明：</p>
<p>1：一定要 using System.Runtime.InteropServices;</p>
<p>2:  [DllImport(&#8220;GeoUrbanApp.exe&#8221;)] 的放置位置要在 class 裡，而不是 namespace 的第1層。</p>
]]></content:encoded>
					
					<wfw:commentRss>https://stackoverflow.max-everyday.com/2018/02/c-the-type-or-namespace-name-dllimport-could-not-be-found/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Listing Folders in a Directory using asp.net and C#</title>
		<link>https://stackoverflow.max-everyday.com/2018/01/listing-folders-in-a-directory-using-asp-net-and-c/</link>
					<comments>https://stackoverflow.max-everyday.com/2018/01/listing-folders-in-a-directory-using-asp-net-and-c/#respond</comments>
		
		<dc:creator><![CDATA[max-stackoverflow]]></dc:creator>
		<pubDate>Fri, 19 Jan 2018 08:17:43 +0000</pubDate>
				<category><![CDATA[VisualStudio筆記]]></category>
		<category><![CDATA[C#]]></category>
		<guid isPermaLink="false">http://stackoverflow.max-everyday.com/?p=1932</guid>

					<description><![CDATA[// YourPage.aspx &#60;%@ ...]]></description>
										<content:encoded><![CDATA[<pre class="lang-cs prettyprint prettyprinted"><code><span class="com">// YourPage.aspx</span>
<span class="pun">&lt;%@</span> <span class="typ">Import</span> <span class="typ">Namespace</span><span class="pun">=</span><span class="str">"System.IO"</span> <span class="pun">%&gt;</span>
<span class="str">&lt;html&gt;</span>
<span class="str">&lt;body&gt;</span>
    <span class="pun">&lt;%</span> <span class="kwd">foreach</span> <span class="pun">(</span><span class="kwd">var</span><span class="pln"> dir </span><span class="kwd">in</span> <span class="kwd">new</span> <span class="typ">DirectoryInfo</span><span class="pun">(</span><span class="str">"E:\\TEMP"</span><span class="pun">).</span><span class="typ">GetDirectories</span><span class="pun">())</span> <span class="pun">{</span> <span class="pun">%&gt;</span>
        <span class="typ">Directory</span><span class="pun">:</span> <span class="pun">&lt;%=</span><span class="pln"> dir</span><span class="pun">.</span><span class="typ">Name</span> <span class="pun">%&gt;&lt;</span><span class="pln">br </span><span class="pun">/&gt;</span>

        <span class="pun">&lt;%</span> <span class="kwd">foreach</span> <span class="pun">(</span><span class="kwd">var</span><span class="pln"> file </span><span class="kwd">in</span><span class="pln"> dir</span><span class="pun">.</span><span class="typ">GetFiles</span><span class="pun">())</span> <span class="pun">{</span> <span class="pun">%&gt;</span>
            <span class="pun">&lt;%=</span><span class="pln"> file</span><span class="pun">.</span><span class="typ">Name</span> <span class="pun">%&gt;&lt;</span><span class="pln">br </span><span class="pun">/&gt;</span>
        <span class="pun">&lt;%</span> <span class="pun">}</span> <span class="pun">%&gt;</span>
        <span class="pun">&lt;</span><span class="pln">br </span><span class="pun">/&gt;</span>
    <span class="pun">&lt;%</span> <span class="pun">}</span> <span class="pun">%&gt;</span>
<span class="pun">&lt;/</span><span class="pln">body</span><span class="pun">&gt;</span>
<span class="pun">&lt;/</span><span class="pln">html</span><span class="pun">&gt;</span></code></pre>
<hr />
<p>我服用中的版本：</p>
<pre> &lt;ul&gt;
 &lt;%
 System.IO.DirectoryInfo diFiles = new System.IO.DirectoryInfo(Server.MapPath("/ImgUpload/"));
 foreach (var f in diFiles.GetFiles())
 {
 Response.Write("&lt;li&gt;&lt;img src='/ImgUpload/" + f.Name + "' width='200'/&gt;&lt;/li&gt;");
 }
 %&gt;
 &lt;/ul&gt;</pre>
]]></content:encoded>
					
					<wfw:commentRss>https://stackoverflow.max-everyday.com/2018/01/listing-folders-in-a-directory-using-asp-net-and-c/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>command-line compile wcf</title>
		<link>https://stackoverflow.max-everyday.com/2018/01/command-line-compile-wcf/</link>
					<comments>https://stackoverflow.max-everyday.com/2018/01/command-line-compile-wcf/#respond</comments>
		
		<dc:creator><![CDATA[max-stackoverflow]]></dc:creator>
		<pubDate>Fri, 19 Jan 2018 04:37:01 +0000</pubDate>
				<category><![CDATA[VisualStudio筆記]]></category>
		<category><![CDATA[C#]]></category>
		<guid isPermaLink="false">http://stackoverflow.max-everyday.com/?p=1930</guid>

					<description><![CDATA[一不小心就學會怎麼寫 WCF 程式了，科科。 下...]]></description>
										<content:encoded><![CDATA[<p>一不小心就學會怎麼寫 WCF 程式了，科科。</p>
<p>下指令：</p>
<p>Run the C# compiler like this:</p>
<pre class="lang-cs prettyprint prettyprinted"><code><span class="pln">  c</span><span class="pun">:</span><span class="pln">\windows\Microsoft</span><span class="pun">.</span><span class="pln">NET\Framework\v</span><span class="lit">3.5</span><span class="pln">\b</span><span class="kwd">in</span><span class="pln">\csc</span><span class="pun">.</span><span class="pln">exe 
            </span><span class="pun">/</span><span class="pln">t</span><span class="pun">:</span><span class="pln">exe </span><span class="pun">/</span><span class="kwd">out</span><span class="pun">:</span><span class="typ">MyApplication</span><span class="pun">.</span><span class="pln">exe </span><span class="typ">MyApplication</span><span class="pun">.</span><span class="pln">cs  </span><span class="pun">...</span></code></pre>
<p>路徑可能會變，也許是  v4.0 或 v4.5</p>
<p>如果是要 build asp.net c# 為dll 要改成 /target:library /out:bin\your-name-space.dll your-cs &#8230;</p>
<hr />
<h4>相關文章：</h4>
<p>使用 csc.exe 建置命令列<br />
<a href="https://docs.microsoft.com/zh-tw/dotnet/csharp/language-reference/compiler-options/command-line-building-with-csc-exe">https://docs.microsoft.com/zh-tw/dotnet/csharp/language-reference/compiler-options/command-line-building-with-csc-exe</a></p>
<p>HOW TO：裝載和執行基本 Windows Communication Foundation 服務<br />
<a href="https://docs.microsoft.com/zh-tw/dotnet/framework/wcf/how-to-host-and-run-a-basic-wcf-service">https://docs.microsoft.com/zh-tw/dotnet/framework/wcf/how-to-host-and-run-a-basic-wcf-service</a></p>
<p>Compiling and Running Code Examples<br />
<a href="https://technet.microsoft.com/en-us/library/ms160695(v=sql.90).aspx">https://technet.microsoft.com/en-us/library/ms160695(v=sql.90).aspx</a></p>
<p>HOW TO：在 IIS 中裝載 WCF 服務<br />
<a href="https://docs.microsoft.com/zh-tw/dotnet/framework/wcf/feature-details/how-to-host-a-wcf-service-in-iis">https://docs.microsoft.com/zh-tw/dotnet/framework/wcf/feature-details/how-to-host-a-wcf-service-in-iis</a></p>
<p>HOW TO：在 Managed 應用程式中裝載 WCF 服務<br />
<a href="https://docs.microsoft.com/zh-tw/dotnet/framework/wcf/how-to-host-a-wcf-service-in-a-managed-application">https://docs.microsoft.com/zh-tw/dotnet/framework/wcf/how-to-host-a-wcf-service-in-a-managed-application</a></p>
<p>How to: Host and Run a Basic Windows Communication Foundation Service<br />
<a href="https://docs.microsoft.com/en-us/dotnet/framework/wcf/how-to-host-and-run-a-basic-wcf-service">https://docs.microsoft.com/en-us/dotnet/framework/wcf/how-to-host-and-run-a-basic-wcf-service</a></p>
<p>&nbsp;</p>
]]></content:encoded>
					
					<wfw:commentRss>https://stackoverflow.max-everyday.com/2018/01/command-line-compile-wcf/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>ASP.NET Cookie</title>
		<link>https://stackoverflow.max-everyday.com/2018/01/asp-net-cookie/</link>
					<comments>https://stackoverflow.max-everyday.com/2018/01/asp-net-cookie/#respond</comments>
		
		<dc:creator><![CDATA[max-stackoverflow]]></dc:creator>
		<pubDate>Mon, 15 Jan 2018 08:57:00 +0000</pubDate>
				<category><![CDATA[VisualStudio筆記]]></category>
		<category><![CDATA[C#]]></category>
		<guid isPermaLink="false">http://stackoverflow.max-everyday.com/?p=1893</guid>

					<description><![CDATA[Asp.net 存取 cookie 範例： ht...]]></description>
										<content:encoded><![CDATA[<p>Asp.net 存取 cookie 範例：<br />
<a href="https://msdn.microsoft.com/zh-tw/library/ms178194(v=vs.100).aspx">https://msdn.microsoft.com/zh-tw/library/ms178194(v=vs.100).aspx</a></p>
<p>&nbsp;</p>
<p>寫入：</p>
<pre>Response.Cookies["userInfo"]["userName"] = "patrick";
Response.Cookies["userInfo"]["lastVisit"] = DateTime.Now.ToString();
Response.Cookies["userInfo"].Expires = DateTime.Now.AddDays(1);

或：

HttpCookie aCookie = new HttpCookie("userInfo");
aCookie.Values["userName"] = "patrick";
aCookie.Values["lastVisit"] = DateTime.Now.ToString();
aCookie.Expires = DateTime.Now.AddDays(1);
Response.Cookies.Add(aCookie);</pre>
<hr />
<p>&nbsp;</p>
<p>讀取：</p>
<pre>if(Request.Cookies["userName"] != null)
    Label1.Text = Server.HtmlEncode(Request.Cookies["userName"].Value);</pre>
<p>&nbsp;</p>
<hr />
<p>&nbsp;</p>
<p>標準用的外框架：</p>
<h2>Page Layout</h2>
<p>The page layout provides the interface of the page. It contains the server controls, text, inline JavaScript, and HTML tags.</p>
<p>The following code snippet provides a sample ASP.NET page explaining Page directives, code section and page layout written in C#:</p>
<pre class="prettyprint notranslate prettyprinted"><span class="com">&lt;!-- directives --&gt;</span>
<span class="pun">&lt;%</span> <span class="lit">@Page</span> <span class="typ">Language</span><span class="pun">=</span><span class="str">"C#"</span><span class="pln"> %&gt;

</span><span class="com">&lt;!-- code section --&gt;</span>
<span class="tag">&lt;script</span> <span class="atn">runat</span><span class="pun">=</span><span class="atv">"server"</span><span class="tag">&gt;</span>

   <span class="kwd">private</span> <span class="kwd">void</span><span class="pln"> convertoupper</span><span class="pun">(</span><span class="pln">object sender</span><span class="pun">,</span> <span class="typ">EventArgs</span><span class="pln"> e</span><span class="pun">)</span>
   <span class="pun">{</span><span class="pln">
      string str </span><span class="pun">=</span><span class="pln"> mytext</span><span class="pun">.</span><span class="typ">Value</span><span class="pun">;</span><span class="pln">
      changed_text</span><span class="pun">.</span><span class="typ">InnerHtml</span> <span class="pun">=</span><span class="pln"> str</span><span class="pun">.</span><span class="typ">ToUpper</span><span class="pun">();</span>
   <span class="pun">}</span>
<span class="tag">&lt;/script&gt;</span>

<span class="com">&lt;!-- Layout --&gt;</span>
<span class="tag">&lt;html&gt;</span>
   <span class="tag">&lt;head&gt;</span> 
      <span class="tag">&lt;title&gt;</span><span class="pln"> Change to Upper Case </span><span class="tag">&lt;/title&gt;</span> 
   <span class="tag">&lt;/head&gt;</span>
   
   <span class="tag">&lt;body&gt;</span>
      <span class="tag">&lt;h3&gt;</span><span class="pln"> Conversion to Upper Case </span><span class="tag">&lt;/h3&gt;</span>
      
      <span class="tag">&lt;form</span> <span class="atn">runat</span><span class="pun">=</span><span class="atv">"server"</span><span class="tag">&gt;</span>
         <span class="tag">&lt;input</span> <span class="atn">runat</span><span class="pun">=</span><span class="atv">"server"</span> <span class="atn">id</span><span class="pun">=</span><span class="atv">"mytext"</span> <span class="atn">type</span><span class="pun">=</span><span class="atv">"text"</span> <span class="tag">/&gt;</span>
         <span class="tag">&lt;input</span> <span class="atn">runat</span><span class="pun">=</span><span class="atv">"server"</span> <span class="atn">id</span><span class="pun">=</span><span class="atv">"button1"</span> <span class="atn">type</span><span class="pun">=</span><span class="atv">"submit"</span> <span class="atn">value</span><span class="pun">=</span><span class="atv">"Enter..."</span> <span class="atn">OnServerClick</span><span class="pun">=</span><span class="atv">"</span><span class="pln">convertoupper</span><span class="atv">"</span><span class="tag">/&gt;</span>
         
         <span class="tag">&lt;hr</span> <span class="tag">/&gt;</span>
         <span class="tag">&lt;h3&gt;</span><span class="pln"> Results: </span><span class="tag">&lt;/h3&gt;</span>
         <span class="tag">&lt;span</span> <span class="atn">runat</span><span class="pun">=</span><span class="atv">"server"</span> <span class="atn">id</span><span class="pun">=</span><span class="atv">"changed_text"</span> <span class="tag">/&gt;</span>
      <span class="tag">&lt;/form&gt;</span>
      
   <span class="tag">&lt;/body&gt;</span>
   
<span class="tag">&lt;/html&gt;</span></pre>
]]></content:encoded>
					
					<wfw:commentRss>https://stackoverflow.max-everyday.com/2018/01/asp-net-cookie/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>[iis] How can i Make CURL representation of my WCF service?</title>
		<link>https://stackoverflow.max-everyday.com/2018/01/iis-how-can-i-make-curl-representation-of-my-wcf-service/</link>
					<comments>https://stackoverflow.max-everyday.com/2018/01/iis-how-can-i-make-curl-representation-of-my-wcf-service/#respond</comments>
		
		<dc:creator><![CDATA[max-stackoverflow]]></dc:creator>
		<pubDate>Mon, 15 Jan 2018 07:44:12 +0000</pubDate>
				<category><![CDATA[VisualStudio筆記]]></category>
		<category><![CDATA[C#]]></category>
		<guid isPermaLink="false">http://stackoverflow.max-everyday.com/?p=1891</guid>

					<description><![CDATA[The following will show ...]]></description>
										<content:encoded><![CDATA[<p>The following will show you how to test your wcf rest service from command prompt using CURL tool. And CURL is a command line tool for getting or sending files using URL syntax. For this I have created a simple wcf rest service which contains three method as below:</p>
<p>[IService1]</p>
<pre class="prettyprint prettyprinted"><span class="pun">[</span><span class="typ">ServiceContract</span><span class="pun">(</span><span class="typ">SessionMode</span> <span class="pun">=</span> <span class="typ">SessionMode</span><span class="pun">.</span><span class="typ">NotAllowed</span><span class="pun">)]</span>
<span class="kwd">public</span> <span class="kwd">interface</span> <span class="typ">IService1</span>
<span class="pun">{</span>
    <span class="pun">[</span><span class="typ">WebGet</span><span class="pun">(</span><span class="typ">UriTemplate</span> <span class="pun">=</span> <span class="str">"date/{year}/{month}/{day}"</span><span class="pun">,</span> <span class="typ">ResponseFormat</span> <span class="pun">=</span> <span class="typ">WebMessageFormat</span><span class="pun">.</span><span class="typ">Xml</span><span class="pun">)]</span>
    <span class="pun">[</span><span class="typ">OperationContract</span><span class="pun">]</span>
    <span class="kwd">string</span> <span class="typ">GetDate</span><span class="pun">(</span><span class="kwd">string</span><span class="pln"> day</span><span class="pun">,</span> <span class="kwd">string</span><span class="pln"> month</span><span class="pun">,</span> <span class="kwd">string</span><span class="pln"> year</span><span class="pun">);</span>

    <span class="pun">[</span><span class="typ">WebGet</span><span class="pun">(</span><span class="typ">UriTemplate</span> <span class="pun">=</span> <span class="str">"greet"</span><span class="pun">,</span> <span class="typ">ResponseFormat</span> <span class="pun">=</span> <span class="typ">WebMessageFormat</span><span class="pun">.</span><span class="typ">Json</span><span class="pun">)]</span>
    <span class="pun">[</span><span class="typ">OperationContract</span><span class="pun">]</span>
    <span class="kwd">string</span> <span class="typ">Greeting</span><span class="pun">();</span>

    <span class="pun">[</span><span class="typ">WebInvoke</span><span class="pun">(</span><span class="typ">Method</span> <span class="pun">=</span> <span class="str">"POST"</span><span class="pun">,</span> <span class="typ">UriTemplate</span> <span class="pun">=</span> <span class="str">"submit"</span><span class="pun">,</span> <span class="typ">BodyStyle</span> <span class="pun">=</span> <span class="typ">WebMessageBodyStyle</span><span class="pun">.</span><span class="typ">WrappedRequest</span><span class="pun">,</span> <span class="typ">ResponseFormat</span> <span class="pun">=</span> <span class="typ">WebMessageFormat</span><span class="pun">.</span><span class="typ">Json</span><span class="pun">,</span> <span class="typ">RequestFormat</span> <span class="pun">=</span> <span class="typ">WebMessageFormat</span><span class="pun">.</span><span class="typ">Json</span><span class="pun">)]</span>
    <span class="pun">[</span><span class="typ">OperationContract</span><span class="pun">]</span>
    <span class="kwd">string</span> <span class="typ">Save</span><span class="pun">(</span><span class="kwd">string</span><span class="pln"> data</span><span class="pun">);</span>

<span class="pun">}</span></pre>
<pre class="x_x_x_x_x_x_x_cpp">[Service1]</pre>
<pre class="prettyprint prettyprinted"><span class="kwd">public</span> <span class="kwd">class</span> <span class="typ">Service1</span><span class="pun">:</span> <span class="typ">IService1</span>
<span class="pun">{</span>
    <span class="kwd">public</span> <span class="kwd">string</span> <span class="typ">GetDate</span><span class="pun">(</span><span class="kwd">string</span><span class="pln"> day</span><span class="pun">,</span> <span class="kwd">string</span><span class="pln"> month</span><span class="pun">,</span> <span class="kwd">string</span><span class="pln"> year</span><span class="pun">)</span>
    <span class="pun">{</span>
        <span class="kwd">return</span> <span class="kwd">new</span> <span class="typ">DateTime</span><span class="pun">(</span><span class="typ">Convert</span><span class="pun">.</span><span class="typ">ToInt32</span><span class="pun">(</span><span class="pln">year</span><span class="pun">),</span> <span class="typ">Convert</span><span class="pun">.</span><span class="typ">ToInt32</span><span class="pun">(</span><span class="pln">month</span><span class="pun">),</span> <span class="typ">Convert</span><span class="pun">.</span><span class="typ">ToInt32</span><span class="pun">(</span><span class="pln">day</span><span class="pun">)).</span><span class="typ">ToString</span><span class="pun">(</span><span class="str">"dddd, MMMM dd, yyyy"</span><span class="pun">);</span>
    <span class="pun">}</span>
   <span class="kwd">public</span> <span class="kwd">string</span> <span class="typ">Greeting</span><span class="pun">()</span>
    <span class="pun">{</span>
        <span class="kwd">return</span> <span class="str">"Hello World"</span><span class="pun">;</span>
    <span class="pun">}</span>
   <span class="kwd">public</span> <span class="kwd">string</span> <span class="typ">Save</span><span class="pun">(</span><span class="kwd">string</span><span class="pln"> data</span><span class="pun">)</span>
   <span class="pun">{</span>
       <span class="kwd">return</span><span class="pln"> data </span><span class="pun">+</span> <span class="str">"Has been saved!"</span><span class="pun">;</span>
   <span class="pun">}</span>
<span class="pun">}</span></pre>
<p>Let&#8217;s send request to first method:</p>
<pre class="prettyprint prettyprinted"><span class="pun">[</span><span class="typ">WebGet</span><span class="pun">(</span><span class="typ">UriTemplate</span> <span class="pun">=</span> <span class="str">"date/{year}/{month}/{day}"</span><span class="pun">,</span> <span class="typ">ResponseFormat</span> <span class="pun">=</span> <span class="typ">WebMessageFormat</span><span class="pun">.</span><span class="typ">Xml</span><span class="pun">)]</span>
    <span class="pun">[</span><span class="typ">OperationContract</span><span class="pun">]</span>
    <span class="kwd">string</span> <span class="typ">GetDate</span><span class="pun">(</span><span class="kwd">string</span><span class="pln"> day</span><span class="pun">,</span> <span class="kwd">string</span><span class="pln"> month</span><span class="pun">,</span> <span class="kwd">string</span><span class="pln"> year</span><span class="pun">);</span></pre>
<p>Then go to command prompt and type following code<br />
<strong>curl http://localhost:12576/Service1.svc/date/2012/1/12</strong></p>
<p>Let&#8217;s send request to second method from curl:</p>
<pre class="prettyprint prettyprinted"><span class="pun">[</span><span class="typ">WebGet</span><span class="pun">(</span><span class="typ">UriTemplate</span> <span class="pun">=</span> <span class="str">"greet"</span><span class="pun">,</span> <span class="typ">ResponseFormat</span> <span class="pun">=</span> <span class="typ">WebMessageFormat</span><span class="pun">.</span><span class="typ">Json</span><span class="pun">)]</span>
    <span class="pun">[</span><span class="typ">OperationContract</span><span class="pun">]</span>
    <span class="kwd">string</span> <span class="typ">Greeting</span><span class="pun">();</span></pre>
<p>Then go to command prompt and type following code:<strong><br />
curl http://localhost:12576/Service1.svc/greet</strong></p>
<p>Now,let&#8217;s send a post request to third method from command prompt:</p>
<pre class="prettyprint prettyprinted"><span class="pun">[</span><span class="typ">WebInvoke</span><span class="pun">(</span><span class="typ">Method</span> <span class="pun">=</span> <span class="str">"POST"</span><span class="pun">,</span> <span class="typ">UriTemplate</span> <span class="pun">=</span> <span class="str">"submit"</span><span class="pun">,</span> <span class="typ">BodyStyle</span> <span class="pun">=</span> <span class="typ">WebMessageBodyStyle</span><span class="pun">.</span><span class="typ">WrappedRequest</span><span class="pun">,</span> <span class="typ">ResponseFormat</span> <span class="pun">=</span> <span class="typ">WebMessageFormat</span><span class="pun">.</span><span class="typ">Json</span><span class="pun">,</span> <span class="typ">RequestFormat</span> <span class="pun">=</span> <span class="typ">WebMessageFormat</span><span class="pun">.</span><span class="typ">Json</span><span class="pun">)]</span>

    <span class="pun">[</span><span class="typ">OperationContract</span><span class="pun">]</span>

    <span class="kwd">string</span> <span class="typ">Save</span><span class="pun">(</span><span class="kwd">string</span><span class="pln"> data</span><span class="pun">);</span>

</pre>
<p><strong>curl  -H &#8220;Content-Type: application/json&#8221; -H &#8220;Accept: application/json&#8221; -X POST -d &#8216;{&#8220;data&#8221;:&#8221;dummy data&#8221;}&#8217; http://localhost:12576/Service1.svc/submit</strong></p>
]]></content:encoded>
					
					<wfw:commentRss>https://stackoverflow.max-everyday.com/2018/01/iis-how-can-i-make-curl-representation-of-my-wcf-service/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
