2024年7月18日 星期四

[筆記][Teams]Teams IncomingWebhook改用Workflow(webhook)

Teams 上收到已下訊息:(2024/7/19看到)

附錄:以下設定。


拿到發送的網址,即可配合程式呼叫。





2024年7月11日 星期四

[筆記][C#]相對網址正式測式區轉換議題。


string Site="https://web.mydomain.com/demo/index.html";

string Site2="https://www.demo.com.tw/index.html";

string relateUrl = "Referee/Index.aspx?rid=123";//新網址

Uri siteUrl = new Uri(Site);//模擬Reuest.Url

Uri siteUrl2 = new Uri(Site2);

var baseUri = siteUrl;

var newUri = new Uri(baseUri,relateUrl); //透過基礎網址跟relate網址去產生正式網址

var baseUri2 = siteUrl2;

var newUri2 = new Uri(baseUri2,relateUrl);

Console.WriteLine(newUri.AbsoluteUri);

Console.WriteLine(newUri2.AbsoluteUri);

 

2024年6月26日 星期三

[筆記]幾個建議的修正polyfill、bootcss、bootcdn、staticfile

參考:

收到google通知:Action Required: Security issue affecting your landing pages
搜尋並查詢一下相關建議:
 - `polyfill.io`
   - `bootcss.com`
   - `bootcdn.net`
   - `staticfile.org`
有引用這些網站相關的javscript 等檔案,建議移除或置換。

2024年6月18日 星期二

[筆記]javascript剪貼簿

https://jsfiddle.net/boc58L0j/3/
https://jsfiddle.net/boc58L0j/9/

<table>

<tr>

  <td>文字一</td>

  <td><input type="button" value="複製" onclick="copy('文字一');"/>

  </td>

</tr>

<tr>

  <td>文字二</td>

  <td><input type="button" value="複製" onclick="copy('文字二');"/>

  </td>

</tr>

</table>

function copy(strInpt) {

  //新增

    var textArea = document.createElement("textarea");

    textArea.value = strInpt;

    document.body.appendChild(textArea);

    textArea.select();

    document.execCommand("Copy");

    textArea.remove();  

    // Alert the copied text

    alert("Copied the text: " + strInpt);

}

function copy(strInpt) {

  //新增

    var copyText = document.createElement("textarea");

    copyText.value = strInpt;

    document.body.appendChild(copyText);

    copyText.select();    

  //copyText.setSelectionRange(0, 99999); // For mobile devices

    // Copy the text inside the text field

  navigator.clipboard.writeText(copyText.value);

    copyText.remove();  

    // Alert the copied text

    alert("Copied the text: " + strInpt);

}

2024年6月9日 星期日

[筆記]Teams建立Chanel取得通知鏈結

  • 2024.06.09版本。
  • 管理的位置藏的很深,這邊作個小筆記。


編輯:點擊後channel右邊側欄會出現【Manage Channel】。


Connectors>找到Edit

搜尋Incomming Webhook > Configure


新增一組Webhook通知,輸入名稱,設定圖示後確定。


Create完成後,畫面會顯示webhook link。



若有需要新增第二組webhook或是管理,請選擇Configured,會顯示之前建立的資料。

2024年5月28日 星期二

[筆記][HtmlToPDF]iText轉PDF

寫在前面

  • 參考:
    • iTextSharp: https://itextpdf.com/products/itextsharp
    • https://www.nuget.org/packages/iTextSharp