server=localhost;database=system;uid=sa;pwd=sa;
这是一个连接数据库的字符串,我想分别把它们的值放到一个数组里面。
比如说:
arr["server"]=localhost;
arr["database"]=system;
arr["uid"]=sa;
arr["pwd"]=sa;没分了,谢谢谢谢了
这是一个连接数据库的字符串,我想分别把它们的值放到一个数组里面。
比如说:
arr["server"]=localhost;
arr["database"]=system;
arr["uid"]=sa;
arr["pwd"]=sa;没分了,谢谢谢谢了
如果用的是2003,那就只有自己写代码了。
{
Regex re=new Regex("[=;]");
string str1="server=localhost;uid=rtr;pwd=111;database=ecm1";
string[] ss=re.Split(str1);
for(int i=0;i<ss.Length;i++)
{
Response.Write(ss[i]);
Response.Write("<br>");
}
}