日期:2014-05-19  浏览次数:20414 次

谁能帮忙把这个转成C# asp.net的一下,谢谢。
sQuerystring   =   Mid(sQuerystring,9)
  sParts   =   Split(sQuerystring,   vbLf)
  iParts   =   UBound(sParts)   -   1
  ReDim   sResults(iParts,   1)
  For   i   =   0   To   iParts
  aParts   =   Split(sParts(i),   "= ")
  sKey   =   aParts(0)
  sValue   =   aParts(1)
  sResults(i,   0)   =   sKey
  sResults(i,   1)   =   sValue

------解决方案--------------------
晕,很多函数不知道是干什么的
------解决方案--------------------
string sQuerystring = " "; string[] sParts; string[] aParts; string sKey = " "; string sValue = " "; string[][] sResults; int iParts; sQuerystring = sQuerystring.Substring(9); sParts = System.Text.RegularExpressions.Regex.Split(sQuerystring, "\r\n "); iParts = sParts.Length - 1; sResults = new string[iParts+1][]; for (int i = 0; i < iParts; i++) { aParts = sParts[i].Split( '= '); sKey = aParts[0]; sValue = aParts[1]; sResults[i] = new string[] { sKey, sValue }; }
------解决方案--------------------
//string sQuerystring = " ";

sQuerystring = sQuerystring.Substring(9);
string[] sParts = sQuerystring.Split( '\r ');
int iParts = sParts.Length -1 ;

string[,] sResults = new string[iParts,1];
for(int i=0;i <=iParts;i++)
{
string[] aParts = sParts[i].Split( '= ');
sResults[i,0]=aParts[0];
sResults[i,1]=aParts[1];
}