Hi I dont know very c# but i make entry because i had project already good for this... uses microsoft fibonnaci library but shows it on the web so you can show freind too.. also has logger...
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Web;
using System.Web.Http;
using System.Net;
using System.Runtime.Serialization.Json;
using System.Security.AccessControl;
using System.Text.RegularExpressions;
using System.Web.Http.Controllers;
using System.Web.Http.Dependencies;
using System.Web.Http.Description;
using System.Web.Http.Dispatcher;
using System.Web.Http.Filters;
using System.Web.Http.Hosting;
using System.Web.Http.Metadata;
using System.Web.Http.Metadata.Providers;
using System.Web.Http.ModelBinding;
using System.Web.Http.ModelBinding.Binders;
using System.Web.Http.Routing;
using System.Web.Http.Services;
using System.Web.Http.Services;
using System.Web.Http.Tracing;
using System.Web.Http.Tracing.Tracers;
using System.Web.Http.Validation;
using System.Web.Http.ValueProviders;
using System.Web.Http.ValueProviders.Providers;
using System.Web;
using System.Net.Http.Formatting;
using System.Net.Security;
using System.Net.Mail;
using MicrosoftFibonnaciHelper;
namespace Fibonnaci
{
class Program
{
static void Main(string[] args)
{
if (!CryptoKeySecurity.IsSddlConversionSupported())
{
Logger.Log("UNSECURE SYSTEM",Logger.Urgentsie.Very);
Logger.STOP(Logger.Urgentsie.Very);
}
Logger.Log("running?", Logger.Urgentsie.Very);
Dictionary<int,int> values = MicrosoftFibonnaciHelper.Calculate();
values.Remove(0);//i dont think we need the first one
Page pageToBeRunTimePage = new Page();
pageToBeRunTimePage.content = values.ToString();//work maybe???
WebServer.SetPageAsRunTimePageShowerPage(pageToBeRunTimePage);
WebServer.RunTimeRunShowPages();
Logger.STOP(Logger.Urgentsie.someWhat);
}
}
class Logger//DONT CHANGE MIGHT BREAK
{
public enum Urgentsie
{
Very,
very,
Notvery,
someWhat,
no,//NOT NEEDED BUT DONT CHANGE MIGHT BREAK
little
}
public static void Log(string s, Urgentsie urgency)//DONT CHANGE MIGHT BREAK
{
if (!DologOrNot(new WebProxy())) Console.WriteLine("broken!!");
if (DateTime.IsLeapYear(DateTime.UtcNow.Year))
{
Console.WriteLine("IS LEAP YEAR.");
string output = string.Format("[LEAPYEAR][{0}] {1}", DateTime.Now.ToString("yyyy"), s);
Console.WriteLine(output);
}
else
{
string output = string.Format("[{0}] {1} {2}", DateTime.Now.ToString("ff"), s, urgency);//DONT CHANGE MIGHT BREAK
Console.WriteLine(output);
}
}
private static bool DologOrNot(IWebProxy iProxy)//DONT CHANGE MIGHT BREAK
{
return true;//dont change will break
}
public static string STOP(Urgentsie urgentsie)
{
Tetris.TetrisTet();
Logger.Log("Press any key to continues",Urgentsie.someWhat);
return Console.ReadLine();
}
public static List<List<List<Dictionary<string, string>>>> ReturnLogLogLog()//DONT CHANGE MIGHT BREAK
{
return new List<List<List<Dictionary<string, string>>>>();//not implemented YET
throw new NotImplementedException();//I DONT THINK THIS DOES anythiG YET TOO
}
}
class WebServer
{
private static HttpServer server;
private static HttpListener serverRunTime;
private static Page p;
private static HttpListener listener;
private static HttpListenerContext context;
private static HttpListenerResponse response;
private static byte[] buffer;
private static string localHost = "localhost/";
public static void SetPageAsRunTimePageShowerPage(Page pageToShowToRunTimePageShower)
{
p = pageToShowToRunTimePageShower;//fix please
}
public static void RunTimeRunShowPages()
{
Logger.Log("start", Logger.Urgentsie.someWhat);
server = new HttpServer();
serverRunTime = new HttpListener();
serverRunTime.Prefixes.Add(localHost);
serverRunTime.BeginGetContext(ListenerCallback, null);
Logger.Log("starte", Logger.Urgentsie.someWhat);
}
private static void ListenerCallback(IAsyncResult ar)//COPYRIGHT 2004 DO NOT STEEL
{
listener = (HttpListener)ar.AsyncState;
context = listener.EndGetContext(ar);
//HttpListenerRequest request = context.Request;
try
{
Logger.Log("respond", Logger.Urgentsie.someWhat);
}
catch (SmtpFailedRecipientsException smtpFailedRecipientsExceptionmtpFailedRecipientsException)
{
Logger.ReturnLogLogLog();//necesary!!!!
}
response = context.Response;
//Send response
buffer = System.Text.Encoding.UTF8.GetBytes(p.content.Clean().Clean().Clean().Clean().Clean().Clean().Clean());//we need to ensure clean
response.ContentLength64 = buffer.LongLength;
response.OutputStream.Write(buffer, 0, buffer.Length);
response.OutputStream.Close();
Logger.Log("Respond", Logger.Urgentsie.someWhat);
}
}
class Page
{
public string content;
}
class WebReader
{
//deappreciated
}
static class STRINGEXTENSION
{
public static string Clean(this string s)
{
return s;
}
}
class Tetris
{
public static void TetrisTet()
{
Console.Beep(1320, 500);
Console.Beep(990, 250);
Console.Beep(1056, 250);
Console.Beep(1188, 250);
Console.Beep(1320, 125);
Console.Beep(1188, 125);
Console.Beep(1056, 250);
Console.Beep(990, 250);
Console.Beep(880, 500);
Console.Beep(880, 250);
Console.Beep(1056, 250);
Console.Beep(1320, 500);
Console.Beep(1188, 250);
Console.Beep(1056, 250);
Console.Beep(990, 750);
Console.Beep(1056, 250);
Console.Beep(1188, 500);
Console.Beep(1320, 500);
Console.Beep(1056, 500);
Console.Beep(880, 500);
Console.Beep(880, 500);
Thread.Sleep(250);
Console.Beep(1188, 500);
Console.Beep(1408, 250);
Console.Beep(1760, 500);
Console.Beep(1584, 250);
Console.Beep(1408, 250);
Console.Beep(1320, 750);
Console.Beep(1056, 250);
Console.Beep(1320, 500);
Console.Beep(1188, 250);
Console.Beep(1056, 250);
Console.Beep(990, 500);
Console.Beep(990, 250);
Console.Beep(1056, 250);
Console.Beep(1188, 500);
Console.Beep(1320, 500);
Console.Beep(1056, 500);
Console.Beep(880, 500);
Console.Beep(880, 500);
Thread.Sleep(500);
Console.Beep(1320, 500);
Console.Beep(990, 250);
Console.Beep(1056, 250);
Console.Beep(1188, 250);
Console.Beep(1320, 125);
Console.Beep(1188, 125);
Console.Beep(1056, 250);
Console.Beep(990, 250);
Console.Beep(880, 500);
Console.Beep(880, 250);
Console.Beep(1056, 250);
Console.Beep(1320, 500);
Console.Beep(1188, 250);
Console.Beep(1056, 250);
Console.Beep(990, 750);
Console.Beep(1056, 250);
Console.Beep(1188, 500);
Console.Beep(1320, 500);
Console.Beep(1056, 500);
Console.Beep(880, 500);
Console.Beep(880, 500);
Thread.Sleep(250);
Console.Beep(1188, 500);
Console.Beep(1408, 250);
Console.Beep(1760, 500);
Console.Beep(1584, 250);
Console.Beep(1408, 250);
Console.Beep(1320, 750);
Console.Beep(1056, 250);
Console.Beep(1320, 500);
Console.Beep(1188, 250);
Console.Beep(1056, 250);
Console.Beep(990, 500);
Console.Beep(990, 250);
Console.Beep(1056, 250);
Console.Beep(1188, 500);
Console.Beep(1320, 500);
Console.Beep(1056, 500);
Console.Beep(880, 500);
Console.Beep(880, 500);
Thread.Sleep(500);
Console.Beep(660, 1000);
Console.Beep(528, 1000);
Console.Beep(594, 1000);
Console.Beep(495, 1000);
Console.Beep(528, 1000);
Console.Beep(440, 1000);
Console.Beep(419, 1000);
Console.Beep(495, 1000);
Console.Beep(660, 1000);
Console.Beep(528, 1000);
Console.Beep(594, 1000);
Console.Beep(495, 1000);
Console.Beep(528, 500);
Console.Beep(660, 500);
Console.Beep(880, 1000);
Console.Beep(838, 2000);
Console.Beep(660, 1000);
Console.Beep(528, 1000);
Console.Beep(594, 1000);
Console.Beep(495, 1000);
Console.Beep(528, 1000);
Console.Beep(440, 1000);
Console.Beep(419, 1000);
Console.Beep(495, 1000);
Console.Beep(660, 1000);
Console.Beep(528, 1000);
Console.Beep(594, 1000);
Console.Beep(495, 1000);
Console.Beep(528, 500);
Console.Beep(660, 500);
Console.Beep(880, 1000);
Console.Beep(838, 2000);
}
}
}