Welcome Guest!
Create Account | Login
Locator+ Code:

Search:
FTPOnline Channels Conferences Resources Hot Topics Partner Sites Magazines About FTP RSS 2.0 Feed

Free Trial Issue of Visual Studio Magazine

email article
printer friendly

Add Telnet to Your .NET Apps
by Leonard Lobel



Quick Facts
PowerTCP Telnet for .NET
Dart Communications
Web: www.dart.com/dotnet/telnet.asp
Phone: 315-339-8040
Price: $349
Quick Facts: A set of controls for implementing Telnet and remote access protocols in .NET applications.
Pros: Easy to use; powerful; many features.
Cons: None.

August 2003 Issue

PowerTCP Telnet for .NET from Dart Communications lets you add streaming Telnet functionality easily to your .NET apps. You can drop a Telnet control onto a VS.NET design surface to instantiate a ready-to-use, module-scoped object in your code immediately. If you prefer, you can set a reference to the control's assembly and hand-code your instantiation. This approach gives you total control over object scope, creation, and lifetime, but requires you to add a licenses.licx file to your project and code event handlers manually (see Figure 1).

The product supports both synchronous and asynchronous modes. Synchronous operation addresses most typical requirements. You invoke the Receive method to block execution until a server response is received. Setting the DoEvents property allows your app to process other events while execution is blocked, so you don't need to resort to asynchronous mode to handle them.

Asynchronous operation runs in the background. Invoking the BeginReceive method spawns a worker thread and causes your app to continue while the server response arrives in parallel execution. The worker thread raises the EndReceive event when it's done, so your app can handle the success or failure of the operation accordingly.

ADVERTISEMENT

Other useful features include a Login method that encapsulates an entire server login conversation, a WaitFor method for easy scripting, automatic option negotiation (you can disable this if necessary), and a TelnetStream class that extends the generic Stream class by performing Telnet-specific formatting of data passing through the stream.

Much of the Telnet control's functionality derives from a base TCP class. This thoughtful design results in consistent operation and behavior across other Dart communication controls that also inherit from TCP.

Three other controls—Rexec, Rlogin, and Rsh—provide the remote login, execution, and shell protocols that Unix hosts typically support. These controls are extremely easy to use with a single method call. They too support asynchronous mode.

The online help is clear and thorough. Concise code samples in VB.NET and C# show how to perform most common tasks. Unfortunately, the sample code refers to classes in the Dart namespace without mentioning or including an appropriate Imports statement. The code works only if you add the Imports statement, or if you prefix the class names in the code with a fully qualified namespace. Otherwise, the documentation and code samples are well-written and easy to follow. You'll also find working demos for all four controls in VB.NET and C#, and an ASP.NET demo that requires additional setup in Internet Information Services.

PowerTCP Telnet for .NET is an excellent product that deserves a place in any serious developer's toolbox.

About the Author
Leonard Lobel is the CEO and founder of Sleek Technologies, a development shop specializing in Microsoft-based solutions, and the director of software for Government Data Publications in New York. Lenni is also a consultant and trainer with more than 24 years of experience. Reach him at .

Back to top














Java Pro | Visual Studio Magazine | Windows Server System Magazine
.NET Magazine | Enterprise Architect | XML & Web Services Magazine
VSLive! | Thunder Lizard Events | Discussions | Newsletters | FTP Home