This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <windows.h> | |
using namespace std; | |
int main(int argc, char const *argv[]){ | |
char org_dir[MAX_PATH]; | |
GetModuleFileName(NULL,org_dir,MAX_PATH); | |
cout << org_dir << endl; | |
return 0; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 獲取最新版本OpenSSHUrl | |
function Get-OpenSSHAsset { | |
param ( | |
[Parameter(Position = 0, ParameterSetName = "")] | |
[ValidateSet( | |
'OpenSSH-Win32.zip', | |
'OpenSSH-Win64.zip', | |
'OpenSSH-Win32.msi', | |
'OpenSSH-Win64.msi' | |
)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@(set "0=%~f0"^)#) & set "1=%*" & setlocal enabledelayedexpansion & powershell -nop -c "iex([io.file]::ReadAllText($env:0));$Host.SetShouldExit($LastExitCode);Exit $LastExitCode" & exit /b !errorlevel! | |
Write-Host "by PSVersion::" $PSVersionTable.PSVersion | |
Write-Host "Command is '$env:0 $env:1'" | |
Exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 檢查鏈接是否有效 | |
function Test-URI { | |
param ( | |
[Parameter(Position=0, Mandatory)] | |
[string] $Uri | |
) | |
try { | |
# 嘗試發送 HEAD 請求 | |
$response = Invoke-WebRequest -Uri $Uri -Method Head -TimeoutSec 10 | |
# 檢查 HTTP 狀態碼是否為 200 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 格式化時間單位 | |
function FormatTimes { | |
param ( | |
[Parameter(Position = 0, ParameterSetName = "", Mandatory=$false)] | |
[double] $Time=0, | |
[Parameter(Position = 1, ParameterSetName = "", Mandatory=$false)] | |
[double] $Digit=3 | |
) | |
# 設定單位 | |
$Unit_Type = 'ms' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/***************************************************************** | |
Name : 讀寫BMP檔案 | |
Date : 2017/11/10 | |
By : CharlotteHonG | |
Final: 2019/08/07 | |
readME : http://bit.ly/2LTHGWN | |
site : https://charlottehong.blogspot.com/2017/06/c-raw-bmp.html | |
*****************************************************************/ | |
#include <stdlib.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
((Get-ChildItem $env:SystemRoot\servicing\Packages)-match("(Microsoft-Windows-GroupPolicy-ClientExtensions-Package~3)(.*?)(\.mum)|(Microsoft-Windows-GroupPolicy-ClientTools-Package~3)(.*?)(\.mum)")).FullName|ForEach-Object{dism /online /norestart /add-package:$_};gpedit.msc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://www.reddit.com/r/edge/comments/s0dmqz/global_media_controls_missing_in_970107255 | |
# 新版本的被禁用功能了 只能從啟動參數處理了... | |
$shortcutName = "Edge_MediaControls" | |
$edgePath = "C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe" | |
$edgeArgs = "--enable-features=GlobalMediaControls" | |
$shell = New-Object -ComObject WScript.Shell | |
$userDsk = [Environment]::GetFolderPath("Desktop") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; chrome version: 97.0.4692.71 | |
CLASS MACHINE | |
CATEGORY !!Google:Cat_Google | |
CATEGORY !!googlechrome | |
KEYNAME "Software\Policies\Google\Chrome" | |
CATEGORY !!GoogleCast_Category | |
POLICY !!EnableMediaRouter_Policy | |
#if version >= 4 | |
SUPPORTED !!SUPPORTED_WIN7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
2021-05-23 | |
部落格說明 https://charlottehong.blogspot.com/2021/05/cc.html | |
*/ | |
#include <iostream> | |
#include <vector> | |
#include <fstream> | |
#include <string> | |
using namespace std; |
NewerOlder