5.1. StarNetworkManager
Class to set printer’s network settings.
Constructor
Name
Contents
Creates the instance.
Method
Supported Method for each models.
Model/Emulation |
mC-Print2 | mC-Print3 | mC-Label3 |
---|---|---|---|
StarPRNT | StarPRNT | StarPRNT | |
Load |
✔ | ✔ | ✔ |
Apply |
✔ | ✔ | ✔ |
5.1.1. StarNetworkManager
Creates the instance.
Declaration
public StarNetworkManager(string portName)
Parameter
Parameter
Contents
Type
portName
It is the same as the portName of the GetPort method.
string
Return value
Contents
Type
StarNetworkManager object
Exception
Contents
Type
When a null to portName is passed
5.1.2. Load
Gets the value specified from the printer.
Declaration
public StarNetworkSetting Load()
Parameter
None
Return value
Contents
Type
Network Settings
Exception
Contents
Type
When port open failsWhen an incorrect portName is passedwhen a communication failure occurs
Examples
private void LoadButton_Click(object sender, RoutedEventArgs e) { string portName = PortNameTextBox.Text; StarNetworkManager manager = new StarNetworkManager(portName); try { StarNetworkSetting setting = manager.Load(); SteadyLanSetting steadyLan = setting.SteadyLan; } catch (StarIODeviceSettingException ex) { } }
Refer to StarIODeviceSettingSDK.
5.1.3. Apply
Set the specified value to the printer.
Important
The printer is reset after this method was executed.
Declaration
public void Apply(StarNetworkSetting setting)
Parameter
Name
Contents
Type
setting
Network Setting Information
Return value
None
Exception
Contents
Type
When port open failsWhen an incorrect portName is passedwhen a communication failure occurs
Examples
private void ApplyButton_Click(object sender, RoutedEventArgs e) { string portName = PortNameTextBox.Text; StarNetworkManager manager = new StarNetworkManager(portName); //Example) When setting to SteadyLanSetting to "Disable" SteadyLanSetting steadyLan = SteadyLanSetting.Disable; StarNetworkSetting setting = new StarNetworkSetting() { SteadyLan = steadyLan }; try { manager.Apply(setting); } catch (StarIODeviceSettingException ex) { } }
Refer to StarIODeviceSettingSDK.