Beispiel #1
0
        //Read data through port asynchronously
        public void AsyncRead(read s, bool start)
        {
            readCallback = s;
            isAsyncRead  = start;
            //serialComPort.Close();
            ////if(start)
            ////{

            ////}
            ////else
            ////{
            ////    serialComPort.DataReceived -= new SerialDataReceivedEventHandler(serialComPort_DataReceived);
            ////}
            //Thread.Sleep(20);
            //Open();
        }
        static void Main(string[] args)
        {
            Console.Write("Introduceti n = ");
            var n = Int32.Parse(Console.ReadLine());

            Mutex m = new Mutex();

            m.WaitOne();
            const string fileToWr = "result.txt";

            m.ReleaseMutex();

            for (int i = 0; i <= n; ++i)
            {
                File.WriteAllText(i.ToString(), (new Random().Next()).ToString());
            }

            read r = new read(readDelegate);

            for (int i = 0; i < n; i++)
            {
                var asyncRes = r.BeginInvoke(i.ToString(), fileToWr, null, null);
            }
        }
Beispiel #3
0
 ' The type of access requested (read/write).
Beispiel #4
0
 dateTimePicker_Tu.Value = DateTime.Parse(read["Bhytgiatritu"].ToString());
Beispiel #5
0
 NaN and Infinity aren't officially supported by JSON (read more about this issue... I lol'd @ the first comment on the first answer)