Visual Basic (Declaration) | |
---|---|
Public ReadOnly Property ClientOptions As OptionCollection |
Visual Basic (Usage) | ![]() |
---|---|
Dim instance As Telnet Dim value As OptionCollection value = instance.ClientOptions |
C# | |
---|---|
public OptionCollection ClientOptions {get;} |
Managed Extensions for C++ | |
---|---|
public: __property OptionCollection* get_ClientOptions(); |
C++/CLI | |
---|---|
public: property OptionCollection^ ClientOptions { OptionCollection^ get(); } |
The following example demonstrates how to set options for automatic option negotiation.
C# | ![]() |
---|---|
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 | ![]() |
---|---|
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 WILL command for the options within the collection.
Target Platforms: Microsoft .NET Framework 2.0