This is my C# program: I have to decode Hex data into normal text in readable format. I prefer to use Hex class from apache library which i downloaded from http://commons.apache.org/codec/download_codec.cgi ,which is a jar file.
Jar files are not accepted by C# compilers. So after bit of googling, i came to know that i have to convert the commons-codec jar file into MSIL first using jbimp.exe from Visual Studio and then import it. I use Visual Studio 2010. But i couldnt find jbimp.exe utility to convert this jar to MSIL. I am unable to find JBimp utility on my system.
Please help me how and where can i get jbimp utility? and also how must i specify the MSIL code as package/namespace to C# file?
My C# code:
using org.apache.commons.codec.binary.Hex;
class mainw
{
private static byte[] secret = new byte[]
{0x33, 0x34, 0x36, 0x32, 0x33, 0x36, 0x36, 0x36, 0x33, 0x36,
0x36, 0x32, 0x33, 0x36, 0x36, 0x36, 0x33, 0x37, 0x33, 0x33,
0x33, 0x36, 0x33, 0x32, 0x33, 0x37, 0x33, 0x35, 0x33, 0x36,
0x36, 0x33, 0x33, 0x36, 0x36, 0x33, 0x33, 0x36, 0x33, 0x35};
public static void main(string[] args)
{
Hex hex = new Hex();
byte[] secretDecoded1 = hex.decode(secret);
byte[] secretDecoded2 = hex.decode(secretDecoded1);
System.out.println("The secret is: "+new String(secretDecoded2));
}
}