예제 #1
0
        private bool DatafromTxt(string FilePath, ref List <byte> lXferData)
        {
            string       line;
            uint         value   = 0;
            SL_IO_Util   strUtil = new SL_IO_Util();
            StreamReader sr      = new StreamReader(FilePath, System.Text.Encoding.Default);

            while ((line = sr.ReadLine()) != null)
            {
                string[] words = line.Split(DelimiterChars);
                foreach (string word in words)
                {
                    if (strUtil.isStrtoUInt(word, ref value))
                    {
                        lXferData.Add((byte)value);
                    }
                }
            }
            return(true);
        }
예제 #2
0
        private byte[] RdBytefromTxt(string FilePath)
        {
            string       line;
            bool         isRight   = true;
            uint         value     = 0;
            SL_IO_Util   Util      = new SL_IO_Util();
            List <byte>  lXferData = new List <byte>();
            StreamReader sr        = new StreamReader(FilePath, System.Text.Encoding.Default);

            while ((line = sr.ReadLine()) != null)
            {
                string[] words = line.Split(DelimiterChars);
                foreach (string word in words)
                {
                    isRight = Util.isStrtoUInt(word, ref value);
                    if (isRight)
                    {
                        lXferData.Add((byte)value);
                    }
                }
            }
            return(lXferData.ToArray());
        }