Run successfully using the code below
in the ps code, variable Cannot be included
$pic='{s1.expandpath}';
Macro PS2
Is there a solution?
in the ps code, variable Cannot be included
$pic='{s1.expandpath}';
Macro PS2
str s1="$desktop$\1.png"
_s=
F
;Add-Type -AssemblyName System.Web;
;$url='https://aip.baidubce.com/rest/2.0/ocr/v1/general_basic';
;$pic='C:\1.png';
;$imagedata=[Web.HttpUtility]::UrlEncode([Convert]::ToBase64String([IO.File]::ReadAllBytes($pic)));
;$poststr=@(
;;;;;'access_token=24.b305c9822131e65eda05e29c157dd719.2592000.1559103982.282335-16139329',
;;;;;$('image='+$imagedata),
;;;;;'language_type=CHN_ENG',
;;;;;'detect_direction=false',
;;;;;'detect_language=false',
;;;;;'probability=false'
;) -join '&';
;$web=New-Object System.Net.WebClient;
;$web.Headers.Add('Content-Type', 'application/x-www-form-urlencoded');
;[byte[]]$postdata=[Text.Encoding]::UTF8.GetBytes($poststr);
;[byte[]]$responsedata=$web.UploadData($url, 'POST', $postdata);
;[Text.Encoding]::UTF8.GetString($responsedata);
str s
PsCmd _s "-Version 2.0" s
mes s
Is there a solution?