首頁
Technology Blog
Cancel

C# Read/Write Excel

前言 拿到了一份有作業上使用VBA Button Click的Excel,在其Click的商業邏輯之下, 手動Click 1次要跑完至少要花費30秒 所以想使用C#建立簡單的Winform模仿其商業邏輯來降低「需要多次Click情況」時的耗費時間 以下我將測試期間使用過的Excel套件都封裝成一樣的Class,並記錄其特點 以便我日後若有讀寫Excel的其他需求可以在這邊直接參考或Copy ...

C Sharp Software Automation Use Bat Execute Powershell Command

ㄔㄧ— layout: post title: C# Software automation Use PowerShell Command date: 2022-11-14 11:10 +0800 — 本次範例執行的指令 Get-Service | Export-CSV c:\temp\service.csv 使用NotePad++將指令另存成ps1檔 以C#執行ps1 建立....

C# Refactoring Reference

前言 開始 Step1. 避免Method的參數為Method的用法 Method : BreakIntoSentences、Cleanup、Breakintosentences Interface : ITextProcessor Class : LinesTrimmer Step2. 將回傳連續String的Method,拆解成物件,且物件繼承相同的Interface Inte...

C# Unit Testing Use NUnit

快速建立專案的示範影片 選擇測試專案 選擇1.建立NUnit測試專案 直接建立NUnit 測試專案 選擇2.建立MSTest測試專案 直接建立MSTest測試專案,並安裝NUnit相關套件 安裝NUnit 與 NUnit3TestAdapter NUnit: NuGet\Install-Package NUnit -Version 3.13.3 NUnit3TestAda...

C# DI Container Use Autofac

使用以下套件 NuGet\Install-Package Autofac -Version 6.3.0 Code Example 使用下來,覺得在使用MVC的時候效果最明顯 Autofac NuGet\Install-Package Autofac -Version 6.3.0 Autofac.Mvc5 NuGet\Install-Package Autofac...

C# Connect MSSQL Use Entity Framework Repository Pattern

快速建立Repository Pattern的影片教學 詳見以下影片與GIT資源直接簡單建立檔案 Github Source Code 1.完成新增ADO.NET的操作 如「Entity Framework Code First if DataBase Exist-1」 2.Creat New Class Name: IRepository.cs using System; usi...

AutoIT Decrypt And Encryption

AutoIT的加密 與 解密 加密 #include <Crypt.au3> ; #include <MsgBoxConstants.au3> ; $sSourceData = "Yyds2241" ; 待加密資料 $sKey = "iamisakey" ; 加密用的 key $algorithm ...

C# WebBrowser Automation Login

首先需要安裝套件 其一:Selenium.WebDriver NuGet\Install-Package Selenium.WebDriver -Version 4.5.1 其二:Selenium.WebDriver.ChromeDriver ( 版本需依據本地Chrome的版本微調) NuGet\Install-Package Selenium.WebDriver.Chr...

C# Web Browser Automation Login Windows Authentication Use AutoIT

開啟新的Visual Studio專案,會使用以下套件 其一:Selenium.WebDriver NuGet\Install-Package Selenium.WebDriver -Version 4.5.1 其二:Selenium.WebDriver.ChromeDriver ( 版本需依據本地Chrome的版本微調) NuGet\Install-Package Sel...

AutoIT Change PowerPoint Default Theme

曾經遇到過要希望能讓全公司的人在使用PPT時,一打開PPT就有公司預設模板的問題 當時是使用AutoIT製作一個exe檔, 將公司的PPT模板放置在網路路徑上 然後透過這個Exe來Copy預設模板,並蓋掉User本機PPT預設模板 備註:須將檔案放置在 C:\Users\AppData\Roaming\Microsoft\Templates  底下,且檔名需要改成blank.potx ...