- Linux
- Windows XP
- Windows Vista
All of the desktop machines (Linux and Windows) share data from the Linux file server. The Widnows machine use a simple authenticated SMB connection to access the file space on the Linux server. In the past I have been created a batch file for my family members to use to connect to the server after they login to a PC. The batch file works but doesn't adapt well to network changes and requires that I had edit these files for them when I make a change. I started a project to create a simple GUI in TCL/TK to make the process easier but I didn't care for the final results of the GUI.
Recently I began exploring C# through the MS Visual Studio. After a number of examples from the tutorials I began writing a utility to replace the network connect batch file with a user interface that would allow easy connection edits but also allow for one click restores of the connection. Below is a screen shot of the resulting C# application:
The application consists of a table of work connections that associate network paths. The table is a GridDataView widget that allows for resizing and reordering the table per the users requirements.
The File menu has the following entries:
The Edit menu has the following entries:
The Speebar has the following entries that correspond to the File and Edit menus:

Connections defined in the tool can be saved to a file through the "Save connections" speed button or File menu entry. The file is saves as an XML file in the users data directory. Sensitive data in the connection file is encrypted to preserve security.
Connections can be verified/validated by using the "Check connections" speed button or File menu. The connection is verified as having a valid path and valid connection point.
The bottom of the window provides a status line and a color coded status symbol. A green status symbol indicates the connections have been loaded into the tool and have not been modified. A red status symbol indicates the connection table has been modified and needs to be verified/saved.
Connections defined by the user can be saved to a file. The file location is the application data path for the current user. This directory, under a normal installation, is secure and readable only by the user. If not, the user should secure the directory to make certain the file is only readable by the user. The contents of the file consists of the defined connections in XML format. The XML format was chosen to allow the contents of the file to be viewable. The password for the user of each connection is stored encrypted. Edits to the password field render the file unusable. If the password field is set to zero length or deleted, the file can be loaded but no password will be available.
How Is NetConnect Used?
<?xml version="1.0"?>
<!--NetConnect network connection defintiions-->
<!--Created: 1/19/2009 10:04 PM-->
<ConnectionSet>
<connection>
<active>True</active>
<path>\\bandura\disk1</path>
<target>S:</target>
<username>ericm</username>
<password>iZ37nyO2g6lOIO/FiLxOizaLnbiysl89rfFc5b/kPLc=</password>
<comment>Bandura file server mount</comment>
</connection>
<connection>
<active>True</active>
<path>\\bandura\disk2</path>
<target>T:</target>
<username>ericm</username>
<password>lAoPOPKlk3wVQ31Cjinu59hxYJ28OwbAjwLrXXvwLcg=</password>
<comment>Bandura scratch/video space</comment>
</connection>
</ConnectionSet>
NetConnect is used in one of two different ways. The first method is to create or define one or more network connections. The defined network connections can be executed by the user interface. If the connections are going to be needed again, they can be stored to the users connection file.
The second method is the automatic restore method. In the automatic restore mode NetConnecti will load the users default connection definition file and attempt to restore/establish the defined connection. Automatic restored mode is enabled using the following command line invocation:
netconnect /execute



