ZennoLab Assemblies Documentation
GetProxy Method
See Also  Example Send Feedback
ZennoLab.CommandCenter Assembly > ZennoLab.CommandCenter Namespace > Instance Class : GetProxy Method

Glossary Item Box

Returns a proxy of the Instance object.

Syntax

C# 
public string GetProxy()

Return Value

Type: System.String

Contains a string of the form "ip:port:isSocks"

Remarks

If a proxy is not used, then the result is "noproxy"

Example

The following example uses the GetProxy method. Parses proxy and gets ip, port, socks.
C#Copy Code
// get proxy
string proxy = instance.GetProxy();
 
// if instance has proxy
if (proxy != "noproxy")
{
    // split string
    string[] args = proxy.Split(':');
    // first is id
    string ip = args[0];
    // second is port
    int port = Convert.ToInt32(args[1]);
    // third is socks or not
    bool s = Convert.ToBoolean(args[2]); 
}
PHPCopy Code
// get proxy
$proxy = $instance->GetProxy();
 
// if instance has proxy
if ($proxy != "noproxy")
{
    // split string
    $args = $proxy->Split(':');
    // first is id
    $ip = $args[0];
    // second is port
    $port = System\Convert::ToInt32($args[1]);
    // third is socks or not
    $s = System\Convert::ToBoolean($args[2]); 
}

Requirements

Target Platforms: Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

© 2013 All Rights Reserved.