首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > asp.net >

List<string>有关问题,求解啊

2012-04-09 
Liststring,问题,求解啊!Liststring str2 new Liststring()str2 BuildSQLString.GetDataTable(

List<string>,问题,求解啊!
List<string> str2 = new List<string>();
 str2 = BuildSQLString.GetDataTable("newadd", "content");
for (int i = 0; i < 2;++i)
  {
  str = str.Replace("$content$", str2[i].ToString());
   
  try
  {
  sw = new StreamWriter(Server.MapPath("~/html/") + fileName, false, code);
  sw.Write(str);
  sw.Flush();
  }
  catch (Exception ex)
  {
  throw ex;
  }
  finally
  {
  sw.Close();

  }
  }
str2[i],为什么总是str2[0]里的值,i自加后,str2[i]里的i还是没变化!!!!

[解决办法]
BuildSQLString.GetDataTable("newadd", "content");
是否正确。
[解决办法]
str是什么?
str = str.Replace("$content$", str2[i].ToString());//i=0时,将str中的"$content$"已经全部替换了,i=1时再替换就没有意义了
[解决办法]
for (int i = 0; i < 2;++i)

是不是这里呢。。。
for (int i = 0; i < 2;i++)

热点排行