Tag Archives: WINFORMS

SSH & TELNET CLIENT

#8 SSH & TELNET CLIENT

SSH & Telnet client

In my previous post I created a very basic telnet only application. So in order to add some new features to the application I will be using the ExtraPutty library.

We need to leverage the ExtraPuTTY.dll in order to use it’s functions in C#. So because ExtraPuTTY.dll is not a COM .dll we can use the DllImport attribute to call the functions within the library.

Calling the methods from ExtraPuTTY.dll

You can use dependency walker to take a closer look at the methods within a .dll file. This is especially useful when you’re building a program and want to see the capabilities of the library you are using.

Dependency Walker is a free utility that scans any 32-bit or 64-bit Windows module (exe, dll, ocx, sys, etc.)

TELNET IN C#

#7 TELNET IN C#

Telnet example…

Writing a small app to communicate over telnet has never been easier. Of course you could just download Putty or use Telnet in Windows CMD but wheres the fun in that?

Writing your own app has tons of perks, automation is what comes to mind… It’s common for programmers to have small helper scripts (for instance running batch scripts in windows to automate installations etc.) but windows .bat and PowerShell scripts can be limiting at times. Especially when you want the user to be amazed by your custom GUI.

The libraries used are ConsoleControl and TentacleSoftware.Telnet.

ConsoleControl allows us to embed a CMD terminal into our Windows Forms or WPF application. In this case we are using Windows Forms.
TentacleSoftware.Telnet is a Telnet library making connecting to the device much easier since we don’t have to write our own sockets protocol etc.

SYSTEM READER IN C#

#5 SYSTEM READER IN C#

A small system reader app written in C# WinForms. The application reads the systems ram, processor and user details and displays them on the form.
On program form load the application will run DXDIAG in the background and will save the text file to the root directory of the application.
Once the program has finished the DXDIAG process you can click on the send button.
This will allow us to send the DXDIAG file to any FTP server we have defined in the program.

As default I have replaced all the necessary details with the # symbol.

replace the # symbol with your FTP server details.

SIMPLE DARK NOTEPAD IN C#

#4 SIMPLE DARK NOTEPAD IN C#

Dark Notepad.

A very simple notepad application using the windows API. The following controls are used:


menuStrip: The topbar menu with integrated drop down boxes. The DarkClass.cs class allows us to change the color of this control.

openFileDialog: Lets us search for and open a file on our windows machine.

saveFileDialog: Allows us to search for a location and save a file.

fontDialog: Shows us the font control menu allowing us to modify our typography inside the text box.

The four main controls in this app

Inside the DarkClass.cs we can change the colors of the menustrip by returning the colors we define in the RGB format Color.FromArgb(46, 204, 113). This class is then called on the application load from the MyRenderer() like so:

menuStrip1.Renderer = new DarkClass.MyRenderer();

The DarkClass.cs class allows us to change the menu strip colors.