| Visual Basic (Declaration) | |
|---|---|
| Public ReadOnly Property ServerOptions As OptionCollection | |
| Visual Basic (Usage) |  Copy Code | 
|---|---|
| Dim instance As Telnet Dim value As OptionCollection value = instance.ServerOptions | |
| C# | |
|---|---|
| public OptionCollection ServerOptions {get;} | |
| Managed Extensions for C++ | |
|---|---|
| public: __property OptionCollection* get_ServerOptions(); | |
| C++/CLI | |
|---|---|
| public: property OptionCollection^ ServerOptions { OptionCollection^ get(); } | |
        The following example demonstrates how to set options for automatic option negotiation.         
             
 
            
            | C# |  Copy Code | 
|---|---|
| if (telnet1.ServerPort == 23) { //Standard telnet port, add standard telnet options telnet1.ClientOptions.Add(new Option(OptionCode.SuppressGoAheads, null, OptionState.RequestOn)); telnet1.ClientOptions.Add(new Option(OptionCode.WindowSize, new Byte[] { ((Byte)(0)), ((Byte)(80)), ((Byte)(0)), ((Byte)(24)) }, OptionState.RequestOn)); telnet1.ClientOptions.Add(new Option(OptionCode.TerminalType, new System.Byte[] { ((Byte)(0)), ((Byte)(116)), ((Byte)(116)), ((Byte)(121)) }, OptionState.RequestOn)); telnet1.ServerOptions.Add(new Option(OptionCode.SuppressGoAheads, null, OptionState.RequestOn)); telnet1.ServerOptions.Add(new Option(OptionCode.Echo, null, OptionState.RequestOn)); telnet1.ServerOptions.Add(new Option(OptionCode.OutputPageSize, null, OptionState.RequestOn)); } else { //Non-standard telnet port, do not send telnet options telnet1.ClientOptions.Clear(); telnet1.ServerOptions.Clear(); } | |
| Visual Basic |  Copy Code | 
|---|---|
| If telnet1.ServerPort = 23 Then 'Standard telnet port, add standart telnet options telnet1.ClientOptions.Add(New [Option](OptionCode.SuppressGoAheads, Nothing, OptionState.RequestOn)) telnet1.ClientOptions.Add(New [Option](OptionCode.WindowSize, _ New System.Byte() { (CByte(0)), (CByte(80)), (CByte(0)), (CByte(24)) }, OptionState.RequestOn)) telnet1.ClientOptions.Add(New [Option](OptionCode.TerminalType, _ New System.Byte() { (CByte(0)), (CByte(116)), (CByte(116)), (CByte(121)) }, OptionState.RequestOn)) telnet1.ServerOptions.Add(New [Option](OptionCode.SuppressGoAheads, Nothing, OptionState.RequestOn)) telnet1.ServerOptions.Add(New [Option](OptionCode.Echo, Nothing, OptionState.RequestOn)) telnet1.ServerOptions.Add(New [Option](OptionCode.OutputPageSize, Nothing, OptionState.RequestOn)) Else 'Non-standard telnet port, do not send telnet options telnet1.ClientOptions.Clear() telnet1.ServerOptions.Clear() End If | |
The client will send a DO command for the options within the collection.
Target Platforms: Microsoft .NET Framework 2.0
 
  