5.1. StarNetworkManager

Class to set printer’s network settings.

  • Constructor

    Name

    Contents

    StarNetworkManager

    Creates the instance.

  • Method

    Name

    Contents

    Load

    Gets the value specified from the printer.

    Apply

    Set the specified value to the printer.

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

    StarNetworkManager

5.1.2. Load

Gets the value specified from the printer.

  • Declaration

    public StarNetworkSetting Load()
    
  • Parameter

    None

  • Return value

    Contents

    Type

    Network Settings

    StarNetworkSetting

  • Exception

    Contents

    Type

    When port open fails
    When an incorrect portName is passed
    when a communication failure occurs

    StarIODeviceSettingException

  • 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

    StarNetworkSetting

  • Return value

    None

  • Exception

    Contents

    Type

    When port open fails
    When an incorrect portName is passed
    when a communication failure occurs

    StarIODeviceSettingException

  • 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.