Unable to use .net class
I am running the powershell code directly, it is successful.
But using pscmd3 is a failure
Macro PS net
I am running the powershell code directly, it is successful.
But using pscmd3 is a failure
Macro PS net
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='{s1.expandpath}';
;$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
PsCmd3 _s "" s
mes s