Click here to Skip to main content
15,882,017 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Is there any way to do this. I know you can add comments to your xml. But this is a little different. Its more like putting after a specified line. Is there any way to do this in c#.

Just to clarify my last question, I actually do not mean how to comment lines out in a .cs file. I meant if there is any way to automate comment or uncomment parts of an xml document using c#. Sorry about the ambiguous question earlier .
Posted
Updated 17-Apr-10 5:00am
v2

C# files are not similar to XML in the way exe/code works. Though Reflection is used to get/modify few things at runtime.

If you try to comment(which can be done using // or /* */) a part of code you are using then it would need a re-compile of the project/dlls in order to work.
 
Share this answer
 
I'm not clear if you want to do this to XML or C#. For XML, yes you can insert a comment into an XML file. For C#, no, it is not possible, runtime code has already been compiled.
 
Share this answer
 
I appreciate the concern which is been rose. The things need to be
sorted out because it is about the individual but it can be with
everyone.The initiative taken for the concern is very serious and need an
attention of every one. This is the concern which exists in the
society and needs to be eliminated from the society as soon as
possible.
=============================================
<a href="http://rapidcarparts.com" rel="dofollow">Car Parts</a>
 
Share this answer
 
At the most very basic, it's called "programming". You put a bunch of code into if/then blocks (or whatever control mechanism might be appropriate) and then, under the appropriate conditions, that code will be or won't be executed.

I don't see what's so hard about that concept.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900