If you want to do something like this you will need to use preprocessor commands and conditional compilation symbols.
I would use symbols that clearly indicate the version of .NET you are targeting (say NET11 and NET20) and then wrap the relevant code like this:
#if NET11
// .NET 1.1 code
#elif NET20
// .NET 2.0 code
#endif
The reason for doing it this way rather than a simple if/else is an extra layer of protection in case someone forgets to define the symbol.
That being said, you should really drill down to the heart of the reason why you want/need to do this.