예제 #1
0
        /// <summary>
        /// LED のパルス点滅
        /// </summary>
        private static void PulseDebugLedTest()
        {
            Debug.Print("Running PulseDebugLedTest()");

            while (true)
            {
                _peach.PulseDebugLed();
                Thread.Sleep(1000);
            }
        }
예제 #2
0
        public static void Main()
        {
            var peach = new Peach();

            var ipAddress = NetworkUtility.InitNetwork();

            if (ipAddress == "0.0.0.0")
            {
                Debug.Print("InitNetwork Failed");
                return;
            }

            using (var request = WebRequest.Create(new Uri("http://www.microsoft.com/ja-jp")) as HttpWebRequest)
            {
                request.Method = "GET";

                using (var response = request.GetResponse() as HttpWebResponse)
                {
                    if (response.StatusCode == HttpStatusCode.OK)
                    {
                        var resContentBytes = new byte[(int)response.ContentLength];
                        using (var ress = response.GetResponseStream())
                        {
                            ress.Read(resContentBytes, 0, (int)response.ContentLength);
                            var resContentChars = Encoding.UTF8.GetChars(resContentBytes);
                            var resContent      = new string(resContentChars);
                            Debug.Print(resContent);
                        }

                        peach.PulseDebugLed(100, 5);
                    }
                }
            }

            Thread.Sleep(3000);
        }