2023年12月28日 星期四

多執行緒使用方式

 C# .net


//Dec.28, 2023 modify this function to apply muti thread.

ThreadPool.QueueUserWorkItem(_ =>

{});


參考:

https://learn.microsoft.com/zh-tw/dotnet/api/system.threading.threadpool.queueuserworkitem?view=net-7.0&WT.mc_id=DOP-MVP-37580

https://blog.darkthread.net/blog/threadpool-thread-management/

2023年9月21日 星期四

2023年7月10日 星期一

2023年2月1日 星期三

SQL TEXT 資料太長 撈不完整

 [SQL]PRINT 超長的字串 | 亂馬客 - 點部落 (dotblogs.com.tw)

SQL TEXT 資料太長 撈不完整

參考上面網址的方式,用分段print的方式顯示


DECLARE @DYNAMIC_SQL NVARCHAR(MAX) --建立一個超過 4,000 字元的變數 SET @DYNAMIC_SQL = N'select 1 as one, 2 as two, 3 as three' WHILE LEN(@DYNAMIC_SQL) < 4000 BEGIN SET @DYNAMIC_SQL = @DYNAMIC_SQL + CHAR(13) + N'union all select 1 as one, 2 as two, 3 as three' END --一次最多只會PRINT 4,000 個字,所以後面的會被截斷 PRINT '--PRINT ALL' PRINT @DYNAMIC_SQL --要全部PRINT出來需要分開來PRINT --每4,000個字就PRINT出來 DECLARE @START_OFFSET INT DECLARE @LEN INT SET @START_OFFSET = 0 SET @LEN = 4000 PRINT '--PRINT BATCH' WHILE (@START_OFFSET < LEN(@DYNAMIC_SQL)) BEGIN PRINT SUBSTRING(@DYNAMIC_SQL, @START_OFFSET, @LEN) SET @START_OFFSET = @START_OFFSET + @LEN END --再把剩下的給PRINT出來 PRINT SUBSTRING(@DYNAMIC_SQL, @START_OFFSET, @LEN)

2022年9月6日 星期二

 mac os iso 下載

修改VMX檔

smc.version="0"



https://www.imacpc.net/archives/4153

11.0版

https://walker-a.com/archives/6962


12版

https://www.geekrar.com/download-macos-ventura-vmdk-file-for-virtualbox-and-vmware/


2022年2月10日 星期四

IIS Rewrite使用範例說明

 參考網址:https://shiyousan.com/post/635648886502897428


該網址好像怪怪的

我擷取下來放PDF

PDF檔

2021年10月20日 星期三

Windows Server 2016 帳號密碼重置

 參考網頁:2 Ways to Reset Forgotten Windows Server 2016 Password | Password Recovery (top-password.com)


  1. Boot the server from the Windows Server 2016 Installation DVD. When the Setup screen appears, press SHIFT + F10 keys to open Command Prompt.
  2. At the Command Prompt, run the following commands:
    d:
    cd Windows\System32
    ren Utilman.exe Utilman.exe.original
    copy cmd.exe Utilman.exe
    shutdown -r -t 0
  3. The server should now reboot and present the logon screen. Press Windows Key + U or click the Ease of Access button, Command Prompt will pop up and type:
    net user Administrator P@ssword123
  4. Close the Command Prompt and you should now be able to log back onto Windows Server 2016 using the password you have provided in the previous step.