| | | | | | | $webclient = New-Object System.Net.WebClient | | $webclient.Encoding = New-Object System.Text.UTF8Encoding -ArgumentList $false | | $dddd_url = 'http://127.0.0.1:9898/ocr/b64/text' | | | | Get-ChildItem -Filter captcha*.* -File | ForEach-Object { | | $sjson = ConvertTo-Json @{image = [Convert]::ToBase64String([IO.File]::ReadAllBytes($_.FullName)) } -Compress | | $webclient.Headers.Add('Content-Type', 'application/json') | | $result = $webclient.UploadString($dddd_url, 'Post', $sjson) | | | | $_ | Add-Member -MemberType NoteProperty -Name Captcha -Value $result -PassThru | | } | Format-List -Property Name, Captcha | | | | $webclient.Dispose()COPY |
|