我将php代码移植到vbnet(我在vbnet上比c#好一点)。在php中是范围解析运算符。相当于范围解析运算符的C#或VBNET?
这里的位:
$args = phpZenfolio::processArgs(func_get_args());
在C#当量/ vbnet?
整个功能如下,我相当于在vbnet中的子新。
public function __construct()
{
$args = phpZenfolio::processArgs(func_get_args());
$this->APIVer = (array_key_exists('APIVer', $args)) ? $args['APIVer'] : '1.4';
// Set the Application Name
if (! isset($args['AppName'])) {
throw new PhpZenfolioException('Application name missing.', -10001);
}
$this->AppName = $args['AppName'];
// All calls to the API are done via POST using my own constructed httpRequest class
$this->req = new httpRequest();
$this->req->setConfig(array('adapter' => $this->adapter, 'follow_redirects' => TRUE, 'max_redirects' => 3, 'ssl_verify_peer' => FALSE, 'ssl_verify_host' => FALSE, 'connect_timeout' => 5));
$this->req->setHeader(array('User-Agent' => "{$this->AppName} using phpZenfolio/{$this->version}",
'X-Zenfolio-User-Agent' => "{$this->AppName} using phpZenfolio/{$this->version}",
'Content-Type' => 'application/json'));
}
下面是过程ARGS位:
private static function processArgs($arguments)
{
$args = array();
foreach ($arguments as $arg) {
if (is_array($arg)) {
$args = array_merge($args, $arg);
} else {
if (strpos($arg, '=') !== FALSE) {
$exp = explode('=', $arg, 2);
$args[$exp[0]] = $exp[1];
} else {
$args[] = $arg;
}
}
}
return $args;
}