Created
December 14, 2016 21:52
-
-
Save matjanos/74b4661db8cf73507f950ab1fb183b51 to your computer and use it in GitHub Desktop.
DevStyle - konkurs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.IO; | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
Console.WriteLine("Hello DevStyle!"); | |
FileStream textStream = File.Open("test.txt",FileMode.Open); | |
try | |
{ | |
StreamReader reader = new StreamReader(textStream); | |
Console.Write(reader.ReadLine()); | |
} | |
finally | |
{ | |
if (textStream != null) | |
((IDisposable)textStream).Dispose(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This file is decompiled to:
Of course
using(...)
statement is an example of syntactic sugar, so compiler changes it into the the code that consist of more basic instructions that are realy implemented in .NET Framework.The dotPeek that I used in order to archive this effect is aware of those syntatic sugars and assumes that developers use them. Compiled IL looks the same in case of
using
and thetry{} finally{}
statements, so the result of decompiling simplify it to nicerusing
.