views:

21

answers:

2

I got a snippet of c# code from Koders and all the code greyed up after

#if CONFIG_CRYPTO && CONFIG_FRAMEWORK_1_2

What I am suppose to do to match the condition?

(I use Visual Studio)

A: 

Suggestions :

  1. put a little more information in your question : a link to the source on Koders.com ? Maybe tell us, in general terms, what the library this is part of is doing ?

  2. Go back to Koders, and examine the complete code for the library (assuming it's not obfuscated), and figure out the role of the Boolean variables CONFIG_CRYPTO and CONFIG_FRAMEWORK_1_2 : what code sets them; what is their function.

  3. Experiment : comment out the #if block enclosure out, and see if the code will work on your machine.

BillW
http://www.koders.com/csharp/fid42100A04C86EF9C6821CE54D50589916EAD4DE40.aspxThis is the snippet and I need the Rfc2898DeriveBytes class, because Winodw Mobile doesnt have it.
Kelvin
A: 

Also note that you can enable conditional compilation flags like these by right-clicking your project in the Solution Explorer, clicking the Build tab, going to the "Conditional compilation symbols" field, and entering "CONFIG_CRYPTO CONFIG_FRAMEWORK_1_2" (symbols separated by a space).

Of course, I agree with BillW, it's nice to understand the purpose behind the symbols first.

Paul Williams