Skip to main content

SalQuickHTTP

Namespace: PPJ.Runtime.Windows.QO

Assembly: PPJ.Runtime.50 (5.0.0.0)

Exposes HTTP retrieval and HTML extraction through a Quick Objects control.

public class SalQuickHTTP : SalCustomControl

Example:

using PPJ.Runtime.Windows.QO;

var control = new SalQuickHTTP();
control.SetSource("https://example.com", "<html><title>Example</title></html>");

Constructors​

Instance member SalQuickHTTP()​

Initializes the HTTP compatibility control.

Properties​

Instance member AppName​

String: Gets or sets the application-name compatibility value. (Default: "")

SalQuickHTTP uses it as the user agent when its client is first created. SalQuickFTP stores it without applying it.

Instance member HttpClient​

SalHttpClient: Gets the lazily created HTTP client.

First access captures AppName as the user agent, sends QOM_ControlCreate, and attaches status-message forwarding.

Instance member Source​

String: Gets or sets the cached HTML source used by extraction methods. (Default: "")

Instance member Title​

String: Gets or sets the stored title compatibility value. (Default: "")

Instance member Url​

SalString: Gets or sets the address associated with the cached source. (Default: "")

Assigning this property does not retrieve a page.

Instance member WindowsClassName​

String: Gets the fixed native window-class name compatibility value. (Default: "")

Returns an empty string; assignments throw InvalidOperationException.

Instance member WindowsDLLName​

String: Gets the fixed native library name compatibility value. (Default: "")

Returns an empty string; assignments throw InvalidOperationException.

Instance member WindowsExStyle​

Int32: Gets the fixed extended native window style compatibility value. (Default: 0)

Returns zero; assignments throw InvalidOperationException.

Instance member WindowsStyle​

Int32: Gets the fixed native window style compatibility value. (Default: 0)

Returns zero; assignments throw InvalidOperationException.

Methods​

Instance member EnumImages(sImages)​

Extracts image-source attributes from cached HTML.

ParameterTypeDescription
sImagesSalArray<SalString>Receives extracted image addresses.

Returns: SalNumber. The number of extracted image sources.

Uses simple tag scanning rather than a full HTML parser.

Extracts link destinations and simple labels from cached HTML.

ParameterTypeDescription
sLinksSalArray<SalString>Receives extracted link destinations.
sTextSalArray<SalString>Receives corresponding labels.

Returns: SalNumber. The number of extracted links.

Uses simple tag scanning rather than a full HTML parser.

Instance member GetPageTitle(sHttpSource, sHttpTitle)​

Extracts text between title tags in supplied HTML.

ParameterTypeDescription
sHttpSourceSalStringThe HTML source.
sHttpTitle by referenceSalStringReceives the title when found.

Returns: SalNumber. The title length, or zero if no complete title is found.

The output is unchanged if no complete title is found.

Instance member GetSource(sHttpUrl, sHttpSource)​

Retrieves an HTTP page and updates Source, Url, and the output string.

ParameterTypeDescription
sHttpUrlSalStringThe HTTP resource address.
sHttpSource by referenceSalStringReceives the retrieved HTML source on success.

Returns: SalNumber. Zero on completion; the negated client error code when a client exception is handled. Cancellation with code zero also returns zero.

The output is unchanged on a handled client error.

Instance member GetSourceSize(sHttpUrl)​

Requests a resource and reads its reported content length.

ParameterTypeDescription
sHttpUrlSalStringThe HTTP resource address.

Returns: SalNumber. The response length, -1 when unknown, or the negated client error code.

Performs a normal request rather than HEAD and does not apply the proxy property.

Protected member SetBoundsCore(x, y, width, height, specified)​

Applies the requested position while fixing the control size at 33 by 33 pixels.

ParameterTypeDescription
xInt32The left coordinate.
yInt32The top coordinate.
widthInt32The requested width; replaced with 33.
heightInt32The requested height; replaced with 33.
specifiedBoundsSpecifiedThe bounds components being changed.

Instance member SetProxy(sProxyName, nProxyPort)​

Sets the proxy used by HTTP source retrieval.

ParameterTypeDescription
sProxyNameSalStringThe proxy address.
nProxyPortSalNumberThe proxy port; appended only when positive.

Returns: SalNumber. Zero on completion; the negated client error code when a client exception is handled. Cancellation with code zero also returns zero.

A positive port is appended to the supplied address. Source-size queries do not apply this proxy.

Instance member SetSource(sHttpUrl, sHttpSource)​

Stores an address and HTML source without making a request.

ParameterTypeDescription
sHttpUrlSalStringThe HTTP resource address.
sHttpSourceSalStringThe HTML source.

Returns: SalNumber. One.

Implements​

NameDescription
ISalWindowExposes SAL message dispatch and runtime metadata for child controls, forms, dialogs, and MDI windows.