DESTest C# sample don't work

Hi,

First, I copied libFrontPanel-pinv.dll, libFrontPanel-csharp.dll into the DES directory, and compiled it with Visual Studio 2005. I got message from OUT window:


The thread 0x578 has exited with code 0 (0x0).
The thread 0xde4 has exited with code 0 (0x0).
The program ‘[4284] DESTester.vshost.exe: Managed’ has exited with code 0 (0x0).

Then I copied the des-xem3001v2.bit into the …\csharp\bin\release directore, renamed it to destop.bit. Also copied the okFrontPanel.dll,
okFrontPanelDLL.cpp,okFrontPanelDLL.h into that directory. Created secret.txt file. Ran: destester d 12345678abcdef01 encrypted.txt decrypted.txt from Command Prompt window. I got the following message:
------- DES Encrypt/Decrypted Tester in C# --------------
Device firmware version: 3.0
Device serial number: zyLc1QAciy
Device ID: Opal Kelly XEM3001
FrontPanel support is available.

Unhandled Exception: System.FormatException: Input string was not in a correct format.
at System.Number.StringToNumber
at System.Byte.Parse
at DESTester.DESTester.Main

Is there any specific set up for the project?

Thanks in advance,

Tony Hu

Good catch. Apparently it was only tested with encryption keys not including “abcdef”.

Ass the following to the top of the .cs file:

using System.Globalization;

Then, change the “Parse” line to:

key* = Byte.Parse(strkey.Substring(i*2, 2), NumberStyles.HexNumber);

That should do the trick. Thanks!*

It worked,

Thanks,

Tony Hu