發表文章

目前顯示的是 2016的文章

Azure Storage 複製

網路上目前看到的寫法都是container間的複製 一直沒找到可用的可以在Storage間互相複製全部container 所以參考網路寫法,自己寫一個 不過實際跑完測試好像還是Azcopy比較快@@ 就當作練習嗎XD #Server side storage copy $SourceStorageAccount = "" $SourceStorageKey = "" $DestStorageAccount = "" $DestStorageKey = "" $SourceStorageContext = New-AzureStorageContext –StorageAccountName $SourceStorageAccount -StorageAccountKey $SourceStorageKey $DestStorageContext = New-AzureStorageContext –StorageAccountName $DestStorageAccount -StorageAccountKey $DestStorageKey $SourceStorageContainer = Get-AzureStorageContainer -Context $SourceStorageContext; foreach ($Container in $SourceStorageContainer) { $Blobs = Get-AzureStorageBlob -Context $SourceStorageContext -Container $Container.Name $BlobCpyAry = @() #Create array of objects $DestStorageContainer = New-AzureStorageContainer $Container.Name -Permission Off -Context $DestStorageContext #Do the copy of everything foreach ($Blob in $Blobs) { Write-Output "Moving $Blob....

'Microsoft.ACE.OLEDB.12.0' 提供者並未登錄於本機電腦上。 (System.Data)

'Microsoft.ACE.OLEDB.12.0' 提供者並未登錄於本機電腦上。 (System.Data) 下載  Access Database Engine 2010 (ACE 2010)  驅動程式 Microsoft Access Database Engine 2010 可轉散發套件 http://www.microsoft.com/zh-tw/download/details.aspx?id=13255 安裝32位元版本 AccessDatabaseEngine.exe /passive 安裝64位元版本 AccessDatabaseEngine_X64.exe /passive 連線字串(Excel 97-2003 Xls files with ACE OLEDB 12.0) Provider=Microsoft.ACE.OLEDB.12.0;Data Source=c:\myFolder\myOldExcelFile.xls; Extended Properties="Excel 8.0;HDR=YES"; 連線字串(Xlsx files) Provider=Microsoft.ACE.OLEDB.12.0;Data Source=c:\myFolder\myExcel2007file.xlsx; Extended Properties="Excel 12.0 Xml;HDR=YES"; "HDR=Yes;" 表示第一列為欄位名稱 參考資料: Microsoft Access Database Engine 2010 可轉散發套件 https://www.microsoft.com/zh-tw/download/details.aspx?id=13255 Microsoft ACE OLEDB 12.0 connection strings https://www.connectionstrings.com/ace-oledb-12-0/

使用MimeKit寄發加密加簽信件

MimeKit 是 .NET Foundation 開放社群的一項專案,提供處理各式Mime格式的函式庫,例如支持 S/MIME 和 PGP,並且支援.NET/Mono的所有平台等。 預設DefaultSecureMimeContext使用SQLite Windows環境可使用WindowsSecureMimeContext 或TemporarySecureMimeContext var joey = new MailboxAddress ("Joey", "joey@friends.com"); var alice = new MailboxAddress ("Alice", "alice@wonderland.com"); var message = new MimeMessage (); message.From.Add (joey); message.To.Add (alice); message.Subject = "How you doin?"; // create our message body (perhaps a multipart/mixed with the message text and some // image attachments, for example) var body = CreateMessageBody (); // now to digitally sign our message body using our custom S/MIME cryptography context using (var ctx = new MySecureMimeContext ()) { // Note: this assumes that "Joey" has an S/MIME signing certificate and private key // with an X.509 Subject Email identifier that matches Joey's email address. message.Body = MultipartSigned....