LinePrinter.GetConfiguration(string PortString, int newPort) Method

Retrieves a configuration string from the printer. Use this method if the Port Type specified in the configuration file is WIFI or SOCKET.

Syntax

[Visual Basic]
Public Function GetConfiguration(portString As string, newPort as int) As String
[C#]
public string GetConfiguration( string portString, int newPort );

Parameters

portString
If the Port Type specified in the configuration file is WIFI, this value replaces ADDRESS in the configuration file.

If the Port Type specified in the configuration file is SOCKET, this value can be any of the following:

newPort
If the Port Type specified in the configuration file is WIFI, this value replaces IPPORT as specified in the configuration file. Many Wi-Fi printers use either port 515 or 9100.

If the Port Type specified in the configuration file is SOCKET, this value can be any of the following:

Return Values

A configuration string as returned by the printer. An empty or null string indicates that the printer is incapable of this function based on a missing or null entry in the printer configuration file.

Remarks

The portString and newPort parameters replace the network address and port specified in the configuration file, allowing easier programmatic determination of the network printer target.

This method may only be called from outside a print job. This function opens the printer, retrieves data, and closes the printer afterwards.

More Information

LinePrinter Class