ValidateUrl Method  
 

Determines if the specified string represents a valid FTP or HTTP URL.

Syntax

object.ValidateUrl( FileUrl [, ServerType ] )

Parameters

FileUrl
A string which specifies the complete URL you wish to validate.
ServerType
An optional integer value which specifies the type of URL which should be validated. If this parameter is omitted, the method will use the value of the ServerType property to determine how the URL should be validated.
Value Description
fileServerUndefined The server type has not been defined and either FTP or HTTP URLs will be accepted.
fileServerFtp The FileUrl parameter must be a valid FTP URL, including both standard and secure connection schemes.
fileServerHttp The FileUrl parameter must be a valid HTTP URL, including both standard and secure connection schemes.

Return Value

A value of True is returned if the string represents a valid URL. A value of False indicates the string is not a valid URL.

Remarks

The ValidateUrl method will check the value of a string to ensure that it represents a complete, valid URL using either a standard or secure FTP or HTTP scheme. This method will not establish a connection with the server to verify that it exists, it will only attempt to resolve the host name to an IP address. If the remote host is specified as an IP address, this method will check to make sure that the address is formatted correctly. Note that if you wish to specify an IPv6 address, you must enclose the address in brackets.

Unlike the URL property, this method will not throw an exception if the specified URL is invalid.

See Also

ServerType Property, URL Property, Connect Method, GetSecurityZone Method