views:

630

answers:

2

I need (preferrably the shortest) program that prints its own source code in C#. I will post it here when I finish it, but if you already have a link your help will be greatly appreciated.

I have come with a solution, but then have found it here. Cuddos to Joey Westcott

+5  A: 

It's called a quine, and there are several listed on Google. For example, http://safalra.com/programming/c-sharp/quines/.

Volte
+2  A: 

Read the program's source file into a string, then print it.

John Millikin
yes, but the string within the string refers to itself, hence the self reference 'escape' tricks used in quines, otherwise you end up with an infinite regress.
Darknight