/// <summary> /// 获取单个产品信息 /// </summary> /// <param name="content"></param> /// <returns></returns> private Product GetSingleProduct(string content) { Product model = new Product(); string regString = "<a href=\"(.*)\" target="; Regex mRegex = new Regex(regString); Match mMatch = mRegex.Match(content); model.ProductURL = string.Format("{0}{1}", m_URLBase, mMatch.Groups[1].Value.Trim()); regString = "title=\"(.*)\" data-domdot"; mRegex = new Regex(regString); mMatch = mRegex.Match(content); model.ProductName = mMatch.Groups[1].Value.ToString(); return model; }
/// <summary> /// 载入单行产品列表 /// </summary> /// <param name="index"></param> /// <param name="model"></param> private void LoadProductValue(int index, Product model) { DataGridViewRow dr = dgvProduct.Rows[index]; dr.Cells["FNO"].Value = (index + 1).ToString("#0000"); dr.Cells["FProductName"].Value = model.ProductName; dr.Cells["FURL"].Value = model.ProductURL; }