PowerTCP Emulation for .NET CF
ClientOptions Property
See Also  Send comments on this topic.
Dart.Emulation Namespace > Telnet Class : ClientOptions Property




Gets a collection of desired client options.

Syntax

Visual Basic (Declaration) 
Public ReadOnly Property ClientOptions As OptionCollection
Visual Basic (Usage)Copy Code
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();
}

Example

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 BasicCopy 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

Remarks

The client will send a WILL command for the options within the collection.

Requirements

Target Platforms: Microsoft .NET Framework 2.0

See Also

Documentation Version 4.2
© 2010 Dart Communications. All Rights Reserved.