2021年12月25日 星期六

[C#]如何使用 WebBrowser 顯示 Echarts 圖表

不錯的文章

https://blog.hungwin.com.tw/winform-echarts/

[Excel]鎂光燈聚焦效果

不錯的教學,學起來

https://www.youtube.com/watch?app=desktop&v=2UoJp6iLz-E&feature=youtu.be





[C#]列舉器 IEnumerator與IEnumerable

 不錯的文章

https://dannyliu.me/c-%e5%88%97%e8%88%89%e5%99%a8-ienumerator%e8%88%87ienumerable/

2021年12月4日 星期六

[C#]VSTO study

文章學習

Application物件——Excel中的Application物件表示Excel應用程式,該物件是所有Excel物件的根,你可以通過Application物件,獲取到其他物件,在外接程式中,我們可以通過下面的方式來獲得Application物件:Globals.ThisAddIn.Application

Workbooks物件代表Workbook物件的集合,而Workbook物件表示Excel中的單個工作簿,我們可以通過下面的方式來獲得工作簿物件:Globals.ThisAddIn.Application.ThisWorkbook

Worksheets物件代表Worksheet物件的集合,而Worksheet代表的就是Excel中的表,下面的程式碼可以獲得Worksheet物件:Globals.ThisAddIn.Application.ThisWorkbook.ActiveSheet (啟用的表,每次開啟一個Excel檔案,都是表一即sheet1被啟用,所以通過該程式碼就說獲得表一物件)

Range物件代表一個範圍,是操作Excel文件最常用的物件,它可以表示為一個單元格、一行、一列或多個單元格塊(可以連續,也可以不連續)的單元格選定範圍,甚至多個工作表中的一組單元格




Visual Studio Tools for Office 簡介
https://blog.poychang.net/vsto-introduction/

VSTO 系列(01)- Excel VSTO 开发入门
https://blog.csdn.net/stone0823/article/details/114587086

VSTO之旅系列
https://www.itread01.com/p/616421.html

How to display "Updating Workflow Status" progress bar in Excel status bar in VSTO?
https://stackoverflow.com/questions/67156788/how-to-display-updating-workflow-status-progress-bar-in-excel-status-bar-in-vs

使用 VSTO C# 刪除 Excel 中的整行
https://vbaoverall.com/delete-entire-row-in-excel-using-vsto-c/

Excel的Range物件(C#)
https://www.itread01.com/content/1548633442.html

Deploying a VSTO Solution Using Windows Installer
https://docs.microsoft.com/en-us/visualstudio/vsto/deploying-a-vsto-solution-by-using-windows-installer?view=vs-2022



2021年11月13日 星期六

]C#]文章

 Debugging External Sources with Visual Studio

https://devblogs.microsoft.com/visualstudio/debugging-external-sources-with-visual-studio/?WT.mc_id=DT-MVP-4015686

2021年9月28日 星期二

[C#]NLog

https://www.uj5u.com/net/116636.html  -->簡單易懂

https://www.tpisoftware.com/tpu/articleDetails/1337

 http://dog0416.blogspot.com/2020/05/aspnet-core-nlog-log.html


另外一種 Serilog
https://www.ruyut.com/2021/10/serilog.html

[C#]Visual Studio:工具程式一檔搞定

 不錯的文章

好像沒那簡單....

https://blog.darkthread.net/blog/ilmerge-task-on-vs/

2021年7月22日 星期四

[C#]多執行緒-優先順序


不錯的文章:

https://www.huanlintalk.com/2013/05/csharp-notes-multithreading-3-priority.html

2021年6月9日 星期三

[Arduino]2 Relay Module

 不錯的文章:

Interface Two Channel Relay Module with Arduino
https://lastminuteengineers.com/two-channel-relay-module-arduino-tutorial/

relay spec:
http://j5d2v7d7.stackpathcdn.com/wp-content/uploads/2015/10/SRD-05VDC-SL-C-Datasheet.pdf

2021年6月8日 星期二

[電學]線性穩壓 IC 電路設計

 

不錯的文章介紹:

https://makerpro.cc/2021/05/electric-power-system-design-part7/?utm_source=GoDaddy&utm_medium=email&utm_content=%E3%80%90%E7%9F%A5%E8%AD%98%E5%85%85%E9%9B%BB%E5%A0%B1%23192%E3%80%91%E7%A1%AC%E9%AB%94%E7%94%A2%E5%93%81%E4%B8%8A%E7%BE%A4%E5%8B%9F%E8%AA%B0%E8%83%BD%E8%84%AB%E7%A9%8E%E8%80%8C%E5%87%BA%3F%2F+5G%E9%A0%98%E8%88%AA%E5%89%B5%E6%96%B0%E6%87%89%E7%94%A8%E7%AB%B6%E8%B3%BD%E7%B7%9A%E4%B8%8A%E8%AA%AA%E6%98%8E%E6%9C%83&utm_campaign=20210519_m163276839_%E3%80%90%E7%9F%A5%E8%AD%98%E5%85%85%E9%9B%BB%E5%A0%B1%23192%E3%80%91%E7%A1%AC%E9%AB%94%E7%94%A2%E5%93%81%E4%B8%8A%E7%BE%A4%E5%8B%9F%E8%AA%B0%E8%83%BD%E8%84%AB%E7%A9%8E%E8%80%8C%E5%87%BA%3F%2F+5G%E9%A0%98%E8%88%AA%E5%89%B5%E6%96%B0%E6%87%89%E7%94%A8%E7%AB%B6%E8%B3%BD%E7%B7%9A%E4%B8%8A%E8%AA%AA%E6%98%8E%E6%9C%83&utm_term=_E8_AA_AA_E6_98_8E_E9_81_B8_E7_94_A8_E4_B8_80_E9_A1_86_E7_B7_9A_E6_80_A7_E7_A9_A9_E5_A3_93+IC+_E6_99

2021年5月23日 星期日

內網穿透?端口轉發?DDNS?反向代理?那些你想要知道的事情

學習一下知識

https://www.youtube.com/watch?v=9u6n45gaXWY

使用 ngrok 產生對外網址,讓本地端也能夠分享給其他人
https://myapollo.com.tw/zh-tw/polly-tool-ngrok/

2021年5月5日 星期三

[C#] Excel 檔案處理

 


ASP.NET Core 教學 - Open XML SDK 匯出 Excel
https://blog.johnwu.cc/article/asp-net-core-export-to-excel.html

2021年5月3日 星期一

Excel] VBA 檔案處理



Excel VBA 檔案目錄選擇對話框使用教學與範例
https://officeguide.cc/excel-vba-file-folder-selection-dialog-tutorial/


Excel VBA 程式設計教學:檔案輸入與輸出
https://blog.gtwang.org/programming/excel-vba-file-input-and-output/


Excel VBA 使用 Split 函數分割字串、放入陣列教學與範例
https://officeguide.cc/excel-vba-function-split-text-string-tutorial/

2021年4月28日 星期三

[Excel] VBA呼叫DLL,然後執行

 也不是很清楚怎用......

試過好像都有問題,放棄

Make a C# DLL and use it from Excel VBA code
http://csharphelper.com/blog/2013/10/make-a-c-dll-and-use-it-from-excel-vba-code/

Turn a simple C# DLL into a COM interop component
https://stackoverflow.com/questions/7092553/turn-a-simple-c-sharp-dll-into-a-com-interop-component

如何正確的在VBA/VB中引用C#/VB.NET開發的DLL
https://www.twblogs.net/a/5b8144a72b71772165abc5c7

HOW TO CALL A C# .NET CLASS LIBRARY FROM EXCEL VBA: GUIDED EXAMPLE
http://maxwellmckinnon.com/blog/2016/10/06/how-to-call-a-c-net-class-library-from-excel-vba-guided-example/

2021年4月27日 星期二

[Exce[] 對應的就是工作簿的BuiltinDocumentProperties 屬性及CustomDocumentProperties 屬性

原來 用CustomDocumentProperties,要這樣設定....又學會了


工作簿之內建文件屬性及自訂文件屬性
https://blog.xuite.net/crdotlin/excel/7698928

2021年4月17日 星期六

[Excel]Study

 

插入欄,H是新欄
Columns("H:H").Select
Selection.Insert Shift:=xlToRight


刪除欄
Columns("I:I").Select
Selection.Delete Shift:=xlToLeft


選取直column
Range("A2").Select ' 選取A2儲存格

Range(Selection, Selection.End(xlDown)).Select ' 選取下方所有儲存格範圍

ActiveCell.Offset(1, 0).Select ' 移至下一個儲存格位置
ActiveCell.Offset(0, 1).Value = XXX  ' 設定內容至目前儲存格的下一欄位置

選取全範圍
Range("A2").Select     '為選定儲存格A2。
Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select '此行指令用於自動偵測選取儲存格內有資料的範圍 (即快速組合鍵Ctrl + Shift + End)

Sheet 新增
WorkAheets.add  '新增一個工作表
WorkSheets.Add()="New Sheet"
WorkSheet,Add after:=WorkSheets(1)     '新增在第一個工作表之後的一個工作表
WorkSheets.Add before:=WorkSheets(2)    '新增在第二個工作表之前的一個工作表



得知選取範圍右下角
Range("A1").Select '設定選取位置的起點,快速鍵 Ctrl + Home data_end = Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Address ' 取得資料最右下角的儲存格位置,例如:J250

選取全部空白儲存格,然後刪除
Range("A1").Select ' 選取A1儲存格,快速鍵 Ctrl + Home
Selection.SpecialCells(xlCellTypeBlanks).Select ' 選取空白儲存格
Selection.EntireRow.Delete ' 刪除空白列


加入清單
Sub unitmenu '單位清單
Columns("F:F").Select ' 選取F欄
With Selection.Validation ' 自訂清單內容
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:="Lesson1,Lesson2,Lesson3,Lennon4" ' 清單內容
End With
End Sub



Chart export to image file
chart.Chart.Export Filename:=ActiveWorkbook.Path & "\bar.jpg", filtername:="jpg"  ' 匯出成圖片

2021年4月13日 星期二

[stm32]SD 卡 and usb stortage

 

不錯的文章



Developing applications on STM32Cube™ with FatFsh
ttps://www.st.com/resource/en/user_manual/dm00105259-developing-applications-on-stm32cube-with-fatfs-stmicroelectronics.pdf

[STM32] SDIO SD 卡讀寫測試
http://www.makdev.net/2020/11/stm32-sdio-sd.html

SD card using SPI in STM32
https://controllerstech.com/sd-card-using-spi-in-stm32/

Tutorial: An SD card over SPI using STM32CubeIDE and FatFS
https://01001000.xyz/2020-08-09-Tutorial-STM32CubeIDE-SD-card/

2021年4月12日 星期一

[Arm]Study

 不錯的文章

https://hackmd.io/@owlfox/Bkcen7LeL/https%3A%2F%2Fhackmd.io%2Fs%2FB1nI1xXie

ARM 之二 Keil 项目/生成的各种文件类型(.AXF、.D、.crf、.exf)说明https://blog.csdn.net/ZCShouCSDN/article/details/81354197

2021年4月8日 星期四

[ESP32 CAM]study

不知道為什麼,用 #define CAMERA_MODEL_WROVER_KIT // Has PSRAM,跑起來會出現如下錯誤訊息:

必須選 #define CAMERA_MODEL_AI_THINKER // Has PSRAM 才行ㄡ




不錯的文章:
阿玉Web:Bit研究區
https://sites.google.com/site/wenyuwebbit/22-esp32-cam/01-ren-shiesp32-cam

ESP32-CAM摄像头-Arduino IDE-网页展示-人脸识别-之七次失败后的成功记录https://www.codenong.com/cs106962217/

ESP32-CAM 開發板(帶攝像頭)
https://ec.makehub.tw/seeed/113990580-esp32-cam-development-boardwith-camera#chinese

[Raspberry]不錯的資料

 

不錯的學習資料

https://hackmd.io/@andrewintw/BJJ1JImM_

https://www.youtube.com/watch?v=VrIP07CeseU&list=PLyHt1h0azRjBHl51dAS10jcCs0XxQ6Iw7&index=3

2021年4月7日 星期三

[C#]模擬鍵盤滑鼠的操作

 學一下:


模擬鍵盤滑鼠的操作
https://roronoa.pixnet.net/blog/post/25312590-c%23-%3A-%E6%A8%A1%E6%93%AC%E6%BB%91%E9%BC%A0%E9%8D%B5%E7%9B%A4%E5%8B%95%E4%BD%9C


How to use Dllimport with interface c#
https://stackoverflow.com/questions/5548401/how-to-use-dllimport-with-interfaces-in-c



2021年4月5日 星期一

[C#]app.config 修改

 

不錯的文章:


讀取 App.Config 中的值
https://dotblogs.com.tw/Frank_Information_Workstation/2016/05/01/165924

C# Winform 操作 App.config(新增、修改、刪除、讀取)https://dotblogs.com.tw/neil_coding/2019/09/25/winform_app_config

Four Ways To Read Configuration Setting In C#
https://www.c-sharpcorner.com/article/four-ways-to-read-configuration-setting-in-c-sharp/

https://ithelp.ithome.com.tw/articles/10196861

2021年3月31日 星期三

[Arm]Program size: Code, RO-data , RW-data, ZI-data 解釋

 

了解...

Keil/MDK 小知識點:Program size: Code, RO-data , RW-data, ZI-data 解釋(什麼意思)https://www.itread01.com/content/1543849446.html

2021年3月25日 星期四

[arduino]Bluetooth(zs-040)



藍芽模組的LED燈號:
連續的快閃:藍芽等待配對中。   --->bluetooth板子的EN腳接地 --->手機可搜尋到裝置
連續的快閃2下後停1下:藍芽已配對成功,運作中。
連續慢速閃爍(約兩秒一次):藍芽已進入AT模式,準備設定。 -->-->bluetooth板子的EN腳3.3V




不錯的文章

藍牙模組(HC05、HC06)常見的指令使用教學
https://blog.cavedu.com/2017/10/18/hc05-hc06/

HC-05藍芽連線
https://sites.google.com/a/ntut.org.tw/jimmyhu/projectlist/hc-05-bluetooth-connect

2021年3月16日 星期二

[arduino]NFC PN532 module

 

不錯的文章

https://ithelp.ithome.com.tw/articles/10220398

PN532 NFC RFID Module
http://wiki.sunfounder.cc/index.php?title=PN532_NFC_RFID_Module

2021年3月14日 星期日

2021年3月11日 星期四

[C#]TabControl Tab標籤背景色設定

 學起來...加油

C# TabControl Tab標籤背景色設定
https://www.itread01.com/p/614894.html

2021年3月5日 星期五

[C#]How to check the status of CAPS / NUMLOCK status


不錯的文章
How to check the status of CAPS / NUMLOCK status in C#.NET
https://dhandrohit.blogspot.com/2011/03/how-to-check-status-of-caps-numlock.html

[C#]mouse do drag drop



namespace mouse_dragdrop
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void textBox1_MouseMove(object sender, MouseEventArgs e)
        {
            if ((e.Button & MouseButtons.Left) == MouseButtons.Left)//判斷是否按下滑鼠左鍵
            {
                Cursor old_cursor = this.Cursor;
                this.Cursor = new Cursor("arrow_l.cur");
                DragDropEffects dropEffect = textBox1.DoDragDrop(textBox1.Text, DragDropEffects.Copy | DragDropEffects.Link);
                this.Cursor = old_cursor;
            }
         }

        private void textBox2_DragEnter(object sender, DragEventArgs e)
        {
            e.Effect = DragDropEffects.Copy;//設定複製操作
        }

        private void textBox2_DragDrop(object sender, DragEventArgs e)
        {
            textBox2.Text = e.Data.GetData(DataFormats.Text).ToString();
        }
    }
}


不錯的文章

C# 基礎拖拉(drag & drop practicts)處理方式
https://petereagle1.wordpress.com/2013/09/23/c-%E5%9F%BA%E7%A4%8E%E6%8B%96%E6%8B%89drag-drop-practicts%E8%99%95%E7%90%86%E6%96%B9%E5%BC%8F/

2021年3月4日 星期四

[raspberry] cross-compile 建立學習

一知半解......


[進階] 安裝 Raspberry Pi 的 Toolchain       -->試過這個可以運作,但要選 -x64版本
https://www.raspberrypi.com.tw/tag/cross-compiler/

What to install under Ubuntu to cross-compile for a Pi4 running Raspbian "buster"?https://www.raspberrypi.org/forums/viewtopic.php?f=131&t=261900&sid=e30a9d49e20c926d07e0a5eb823fa256

CODE CRAFT: CROSS COMPILING FOR THE RASPBERRY PI
https://hackaday.com/2016/02/03/code-craft-cross-compiling-for-the-raspberry-pi/

ross-compile and deploy Qt 5.12 for Raspberry Pi
https://mechatronicsblog.com/cross-compile-and-deploy-qt-5-12-for-raspberry-pi/


Kernel building
https://www.raspberrypi.org/documentation/linux/kernel/building.md

Compiling Raspberry pi 0 W Kernel
https://www.linkedin.com/pulse/compiling-raspberry-pi-0-w-kernel-athul-pk

2021年3月3日 星期三

[raspberry]GPIO操控

 https://hackmd.io/reU-6s5XTUGacTD_5IMgmA?view

不錯的文章



GPIO Programming: Using the sysfs Interface
https://www.ics.com/blog/gpio-programming-using-sysfs-interface

中斷突進!簡單的 IRQ 程式
https://ithelp.ithome.com.tw/articles/10253026

[C#]模擬鍵盤操作SendKey()

連續 SendKeys.SendWait 比較像鍵盤輸入,會有停頓的效果....

textBox1.Focus();
SendKeys.SendWait("A");
SendKeys.SendWait("{B 10}");
SendKeys.SendWait("+C");

C# 模擬鍵盤操作SendKey(),SendKeys()
https://www.itread01.com/content/1548344359.html

2021年3月1日 星期一

2021年2月28日 星期日

[C#] 攔截系通資訊/限制滑鼠活動範圍/拖檔案進入


攔截系統資訊取的滑鼠或鍵盤操作
本來以為只能透過 WndProc,原來還有其他做法,學起來,.....

namespace sysinfo
{
    public partial class Form1 : Form
   {
        MessageFilter mf = new MessageFilter();
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            Application.AddMessageFilter(mf);
        }

        private void Form1_FormClosing(object sender, FormClosingEventArgs e)
        {
            Application.RemoveMessageFilter(mf);
        }
    }

    public class MessageFilter : IMessageFilter
    {
        public bool PreFilterMessage(ref Message m)
        {
            switch (m.Msg)
            {
                case 513:
                    MessageBox.Show("LEF_BUTTON!", "SYS");
                    return true;
                case 516:
                    MessageBox.Show("RIGHT_BUTTON!", "SYS");
                    return false;
                default:
                    return true;
                }
            }
        }
    }


namespace mouse_area
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            this.Cursor = new Cursor(Cursor.Current.Handle);
            Cursor.Position = new Point(Cursor.Position.X, Cursor.Position.Y);
            Cursor.Clip = new Rectangle(this.Location,this.Size);
        }

        private void button2_Click(object sender, EventArgs e)
        {
            Screen[] screens = Screen.AllScreens;
            this.Cursor = new Cursor(Cursor.Current.Handle);
            Cursor.Clip = screens[0].Bounds;
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            this.AllowDrop = true;
        }

        private void Form1_DragEnter(object sender, DragEventArgs e)
        {
            if(e.Data.GetDataPresent(DataFormats.FileDrop))
            {
                string[] files = (string[])e.Data.GetData(DataFormats.FileDrop);

                for(int i=0;i<files.Length;i++)
                {
                    listBox1.Items.Add(files[i]);
                }

            }
        }
    }
}



2021年2月18日 星期四

[Excel]外部連結取得網頁資料,編輯更新現有連線

看看...

Excel外部連結取得網頁資料,編輯更新現有連線
https://www.b88104069.com/archives/4400

[C#]GitHub代碼一鍵轉VS Code:只需+1s

 看起來蠻不錯的,不知使用起來如何...


GitHub代碼一鍵轉VS Code:只需+1s
https://bangqu.com/6f87QG.html

2021年2月1日 星期一

[C#]Tuple 語法與參數陣列

 

感覺不錯,學一下,持續進步!!!

https://www.huanlintalk.com/2017/04/c-7-tuple-syntax.html
https://dotblogs.com.tw/hung-chin/2011/10/03/38682

直流馬達的挑選



不錯的文章,淺顯易懂
https://jk3527101.pixnet.net/blog/post/14108743

2021年1月10日 星期日

[Linux]Linux 手動更改系統時間

 vmware  啟動的 ubuntu 時間怪怪的,與 windows 桌面不同,不知怎修正...##$%^6^

不錯的文章

Linux 手動更改系統時間:date、hwclock 與 timedatectl 指令用法教學
https://blog.gtwang.org/linux/howto-set-date-time-from-linux-command-prompt/

Linux 設定 NTP 同步系統時間,自動網路校時教學
https://blog.gtwang.org/linux/linux-ntp-installation-and-configuration-tutorial/

2021年1月4日 星期一

[raspberry pi]問題收集

 

安裝 Raspberry Pi 的 Toolchain
https://www.raspberrypi.com.tw/405/using-a-cross-compiler-for-raspberry-pi/