MyException - 我的异常网
当前位置:我的异常网» C# » 新手:关于委托与事件的有关问题

新手:关于委托与事件的有关问题(6)

www.MyException.Cn  网友分享于:2013-02-20  浏览:11次

                inputData = (byte)port.ReadByte();
                
                if (inputData.Equals(0xa))
                {
                    idx = 0;
                }
                else if (inputData.Equals(0xd))
                {
                    byte[] b = new byte[idx];
                    Array.Copy(readcache, b, idx);
                    s2 = Encoding.ASCII.GetString(b);
                    st(s2);
                    idx = 0;

                }
                else
                {
                    readcache[idx] = inputData;
                    idx++;
                    idx %= 1024;
                }
            }
        }
        catch
        {
        }

        
    }
    public void st(string s2)
    {
        s3 = s2;
    }

    public void SendMsg(string phone, string msg)
    {
       port.WriteLine(phone);
       port.WriteLine(msg);

    }

    private void Delay(int mm)
    {
        DateTime current = DateTime.Now;

        while (current.AddMilliseconds(mm) > DateTime.Now)
        {
            Application.DoEvents();
        }

文章评论

软件开发程序错误异常ExceptionCopyright © 2009-2015 MyException 版权所有