Start() public method

public Start ( ) : void
return void
Example #1
0
        static void Main(string[] args)
        {
            // http://www.codeproject.com/Articles/742260/Simple-Web-Server-in-csharp
            WebServer ws = new WebServer();

            ws.Start(IPAddress.Loopback, 666, @"C:\Source\Github\SEDC-DataServer\Site");
        }
        public static void Main()
        {
            //NetworkInterface.GetAllNetworkInterfaces()[0].EnableDhcp();
            NetworkInterface.GetAllNetworkInterfaces()[0].EnableStaticIP("192.168.0.16","255.255.255.0","192.168.0.1");
            //            NetworkInterface.GetAllNetworkInterfaces()[0].RenewDhcpLease();

              //          var ipAddress = NetworkInterface.GetAllNetworkInterfaces()[0].IPAddress;

            Thread.Sleep(1000);

            Debug.Print("Dirs: ");
            Debug.Print(Directory.GetCurrentDirectory());
            Directory.SetCurrentDirectory(@"\SD");
            string[] dirs = Directory.GetDirectories(@"\SD");

            var webServer = new Server.WebServer {WebFolder = WebFolder, Port = 80};

            webServer.Start();

            var led = new OutputPort(Pins.ONBOARD_LED, false);
            while (true)
            {
                // Blink LED to show we're still responsive
                led.Write(!led.Read());
                Thread.Sleep(2000);
            }
        }
Example #3
0
        static void Main(string[] args)
        {
            // http://www.codeproject.com/Articles/742260/Simple-Web-Server-in-csharp
            WebServer ws = new WebServer();

            ws.Start(IPAddress.Loopback, 666, @"C:\Source\Github\SEDC-DataServer\Site");
        }
        static void Main(string[] args)
        {
            System.Timers.Timer aTimer = new System.Timers.Timer();
            aTimer.Elapsed += new ElapsedEventHandler(OnTimedEvent);
            aTimer.Interval = 5000;
            aTimer.Enabled  = true;
            WebServer websocketServer = new WebServer();

            websocketServer.Start("http://localhost:80/WS/");
            Console.WriteLine("Press any key to exit..");
            Console.ReadKey();
        }
Example #5
0
 static void Main()
 {
     string dir = Environment.CurrentDirectory;
     dir = dir.Replace("\\Server\\bin", "");
     dir += "\\WebApplication1\\";
     WebServer server = new WebServer(new[] {"http://localhost:8000/test/"}, dir);
     server.Start();
     Console.ReadLine();
 }