C#写的读取ISO2709格式数据的DLL[3]

[入库:2006年2月23日] [更新:2007年3月24日]

本文简介:

   }
   if(strSubFld == null)
    return 0;
   return 1;
  }

  //从字段中获得出现次数字段组
  // -1 error
  // 0 not found
  // 1 found
  public int GetFieldGroup(string strFld,
   int nIndex,
   out string strGroup)
  {
   strGroup = null;
   
   if(strFld == null)
    return -1;
   
   char[] chData = strFld.ToCharArray();
   int nPos = 0;
   string strSplit = "a"; // 一般以a子字段为字段组区分
   int nFound = 0; // 0: not 1: first time found 2: second time found
   while( nPos < chData.Length)
   {    
    nPos ++; 
 
    if((chData[nPos-1] == SUBFLD) && (chData[nPos].ToString() == strSplit))
     nFound ++; // found    

    if (nFound == nIndex)
     strGroup += chData[nPos].ToString();
    if(nFound > nIndex)
     break;    
   }
   if(strGroup == null)
    return 0;
   return 1;
  }
  //获得字符的长度
  //
  private int GetCharLength(char ch)
  {
   int nLength = 0;
   
   if((short)ch < 0 || (short)ch  > 128)
   {
    nLength += 2;
   }
   else
   {
    nLength = nLength + 1;
   }
   return nLength;
  }

  public string strMarc
  {
   get
   {
    return m_strMarc;
   }
   set
   {
    m_strMarc = value;
   }

本文关键:C#写的读取ISO2709格式数据的DLL
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top