This sample allows you to highlight C# source code. Highlighting is based on http://hilite.me web service, which is called from a background job in a truly asynchronous way – neither controller, nor any other entity is waiting for a completion. Results are delivered via WebSockets using SignalR.
All the snippets are removed every day at 12:00 AM UTC.
byte[] attachment = (byte[])null; string fileName = string.Empty; if (fileAttachment != null) { if (fileAttachment.ContentLength > 0) { attachment = new byte[fileAttachment.InputStream.Length]; fileAttachment.InputStream.Read(attachment, 0, (int)fileAttachment.InputStream.Length); } fileName = fileAttachment.FileName; }
Console.WriteLine("Hello, world!");