Category Archives: Programming

Using special national characters in unittests with NBI

First of all, if you have a .csv file containing the results that you want to compare with your test and the result contains special national characters, then you need to encode the file in Unicode before saving the file. You change the encoding in Notepad for Windows as shown below.


If your .mdx file with the test to perform contains national characters in Danish that could be the characters æ (ae), ø (oe) and å (aa). Then you have to translate them to these characters to make them work.

æ æ
Æ Ã†
ø ø
Ø Ã˜
å Ã¥
Å Ã…

More characters can be found here.

An example of and MDX-query with national characters for in .mdx file for unittesting in NBI would look like the query below.


Encryption and decryption i C#

This link has by far the most well documented guide to encryption and decryption in C#. It uses the Rijndael Class.

There are three different enryption class for AES in the .NET framework. AES is a standard of Rijndael.

When I get some more time I will write a bit more about encryption in the .NET Framework. I can recommend Pluralsights course on encryption in .NET.

ILMerge and automated program transfer

Incorporating the DevExpress components in your executable can be done using ILMerge. In my case ILMerge is run through a .bat-file and works like this :

.\ILMerge\ILMerge.exe /targetplatform:v4 /target:winexe /out:.\OutputDir\mss.exe mss.exe .\DevExpress\DevExpress.BonusSkins.v11.1.dll .\DevExpress\DevExpress.Data.v11.1.dll
.\DevExpress\DevExpress.OfficeSkins.v11.1.dll .\DevExpress\DevExpress.Printing.v11.1.Core.dll
.\DevExpress\DevExpress.Utils.v11.1.dll .\DevExpress\DevExpress.XtraEditors.v11.1.dll

It takes mss.exe and the DevExpress DLL’s and merges them into one executable .\OutputDir\mss.exe

Right after that .\OutputDir\mss.exe is compressed using 7zip.

.\7zip\7z.exe a .\OutputDir\ .\OutputDir\mss.exe

And finally it is transferred to the website using WinSCP. I’m using Windows XP and as far as I know the build in ftp-client doesn’t support passiv FTP. I believe that ftp-clients in later versions of Windows does support passiv FTP. So if your using a later version than XP of Windows. You can do essentially the same thing with the build in ftp-client. But if your using XP and is connecting to a passiv FTP-server, you can use WinSCP.

.\FTP\winscp.exe /script=”.\FTP\script.txt”

Script.txt looks like this:

open <session in WinSCP>
option confirm off
put “.\OutputDir\MSS.ZIP” “/Programs/MSS.ZIP”

“Options confirm off” lets you overwrite a file without being prompted. You also need to create a session in WinSCP (GUI) or else you will get the following message:

Automatic actions are disabled when URL address is provided on command-line.