Esempio n. 1
0
        public string ToCommCodeString(CMSMStruct.CommStruct comtmp)
        {
            StringBuilder sb = new StringBuilder(1024);

            sb.Append(comtmp.strCommName);
            sb.Append(",");
            sb.Append(comtmp.strCommCode);
            sb.Append(",");
            sb.Append(comtmp.strCommSign);
            sb.Append(",");
            sb.Append(comtmp.strComments);
            return(sb.ToString());
        }
Esempio n. 2
0
        public bool CommParseLine(string strValue, string strSplit, out CMSMStruct.CommStruct comtmp, out Exception err)
        {
            int i = 0;

            comtmp = new CMSMStruct.CommStruct();
            err    = null;
            try
            {
                string[] strFields = strValue.Split(strSplit.ToCharArray());
                comtmp.strCommName = strFields[i++];
                comtmp.strCommCode = strFields[i++];
                comtmp.strCommSign = strFields[i++];
                comtmp.strComments = strFields[i++];
            }
            catch (Exception e)
            {
                err = e;
                return(false);
            }
            return(true);
        }