發表文章

目前顯示的是 10月, 2022的文章

HTML特殊符號

  &lt; < 小于号或显示标记 &gt; > 大于号或显示标记 &amp; & 可用于显示其它特殊字符 &quot; “ 引号 &reg; ® 已注册 &copy; © 版权 &trade; ™ 商标 &ensp;   半个空白位 &emsp;   一个空白位 &nbsp;   不断行的空白 ref web: https://developer.aliyun.com/article/614020

SoapUI

  <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tip="http://www.dsc.com.tw/tiptop/TIPTOPServiceGateWay">    <soapenv:Header/>    <soapenv:Body>       <tip:UpdateStockInPostRequest>          <tip:request> 轉換後XML放這裡, 要把 < 取代為 &lt;           </tip:request>       </tip:UpdateStockInPostRequest>    </soapenv:Body> </soapenv:Envelope> 另一種方法 <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tip="http://www.dsc.com.tw/tiptop/TIPTOPServiceGateWay">    <soapenv:Header/>    <soapenv:Body>       <tip:UpdateStockInPostRequest>          <tip:request> <![CDATA[ 原來XML ]]           </tip:request>       </tip:UpdateStockInPostRequest>    </soapenv:Body> </soapenv:Envelope>

C# 取得IP方式

  /// <summary> /// 取得本機 IP Address /// </summary> /// <returns> </returns> private List< string > GetHostIPAddress ( ) { List< string > lstIPAddress = new List< string >(); IPHostEntry IpEntry = Dns.GetHostEntry(Dns.GetHostName()); foreach (IPAddress ipa in IpEntry.AddressList) { if (ipa.AddressFamily == AddressFamily.InterNetwork) lstIPAddress.Add(ipa.ToString()); } return lstIPAddress; // result: 192.168.1.17 ...... } /// <summary> /// 取得外網 IP Address /// </summary> /// <returns> </returns> private string GetExtranetIPAddress ( ) { HttpWebRequest request = HttpWebRequest.Create( " http://www.whatismyip.com.tw " ) as HttpWebRequest; request.Method = "GET" ; request.ContentType = "application/x-www-form-urlencoded" ; request.UserAgent = "Mozilla/5.0" ; string ip = string .Empty;

C# 2個List比較差異 (Linq Excep)

  List<string> strList1 = new List<string>(){"a", "b", "c", "d"}; List<string> strList2 = new List<string>() { "a", "b", "f", "e"}; var strList3 = strList1.Except(strList2).ToList(); strList1排除strList2的資料, 結果為 c, d ref web: https://www.cnblogs.com/xinianxinqix/p/9204534.html

MSSQL 新增資料到自動識別欄位方法

 先執行下面語法, 允許寫入 自動識別欄位, SET IDENTITY_INSERT [ TABLE_NAME] ON ; 再執行要異動的SQL, 最後再執行下面語法, 變更欄位為 不允許寫入   ( 因為自動識別欄位名稱要存在SQL內, 所以不能使用 select * from tableA的語法, 欄位要逐一列出, 並且包含自動識別欄位 ) ※ 只有在自動識別欄位出現在 INSERT INTO 陳述式的資料行清單中時,SET IDENTITY_INSERT 才能設置為 ON。 SET IDENTITY_ INSERT [ TABLE_NAME] OFF ; ref web: https://exfast.me/2016/09/mssql-automatic-identification-field-when-required-insert-when-information-should-be-how-do/