我尝试了一个来自Phalanger的教程和一个Webbrowser,它可以工作! :)但现在我尝试自动登录到一个网站,但我无法使用Windows Webform控件发送额外的身份验证标头。它给了我找不到的方法!我想念s / th吗?
$authData = "test@mail.com:test";
$authHeader = "Authorization: Basic " + base64_encode($authData) + "\r\n" + "User-Agent: MyUserAgent\r\n";
$this->browser->navigate($url,"",null,$authHeader);
我查看了文档,Windows Webforms Navigate方法需要4个变量,但它总是找不到方法! 我也尝试了
$authData = utf8_encode("test@mail.com:test");
但是这给我错误函数utf8_encode找不到?对不起,如果这是一个愚蠢的问题。感谢。
编辑:异常详情:
PHP.Core.PhpException was unhandled by user code
Message: An exception of type 'PHP.Core.PhpException' occurred in PhpNetCore.dll but was not handled in user code
Additional information: Call to undefined function: 'test\utf8_encode'