Don Carlos
27.10.2007, 19:40
Klar. Der obere Code ist mit dem GeSHi - Plugin formatiert - der Code darunter mit der normalen PHP - Funktion.
http://csharp-world.de/showthread.php?tid=71
http://csharp-world.de/showthread.php?tid=71
code}
white-space:pre;
}
<div class="code_header">Code CSHARP :<br /></div>
<div class="code_body"><div dir="ltr"><code><span style="color: #0600FF;">namespace</span> Lernen <span style="color: #000000;">{</span><br />
<br />
<span style="color: #FF0000;">class</span> MainClass <span style="color: #000000;">{</span><br />
<br />
<span style="color: #0600FF;">public</span> <span style="color: #0600FF;">static</span> <span style="color: #0600FF;">void</span> Main<span style="color: #000000;">(</span><span style="color: #FF0000;">string</span><span style="color: #000000;">[</span><span style="color: #000000;">]</span> args<span style="color: #000000;">)</span> <span style="color: #000000;">{</span><br />
MyClass1 obj = <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> MyClass1<span style="color: #000000;">(</span><span style="color: #000000;">)</span>;<br />
obj.<span style="color: #0000FF;">Ereignis</span> += <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> Zeiger<span style="color: #000000;">(</span>Handler<span style="color: #000000;">)</span>; <span style="color: #008080; font-style: italic;">//Event wird an Eventhandler gebunden</span><br />
obj.<span style="color: #0000FF;">Zahl</span> = <span style="color: #FF0000;">0</span>;<br />
<br />
<span style="color: #000000;">}</span><br />
<br />
<span style="color: #0600FF;">public</span> <span style="color: #0600FF;">static</span> <span style="color: #0600FF;">void</span> Handler<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">{</span><br />
Console.<span style="color: #0000FF;">WriteLine</span><span style="color: #000000;">(</span><span style="color: #808080;">"Ungültiger wert"</span><span style="color: #000000;">)</span>;<br />
<span style="color: #000000;">}</span><br />
<br />
<br />
<span style="color: #000000;">}</span><br />
<span style="color: #000000;">}</span></code></div></div>