3

我想将大量值存储到此链接,以便以这种样式将值传递给 aspx 页面,如何增加值的数量。

htmlBody = string.Format(" Hi "+userName+ 
"\n Thank you for creating an account with RSS MANAGEMENT SYSTEM \n </ br>" + 
"Please click the below link to activate your account <br />" + 
"<a href='http://localhost:2386/ActivateUser.aspx?userName{0}&Id={1}'>Activate {0} </a>",
UName, user_name);
4

2 回答 2

1

所以你的意思是这样的:

var someothervalue=1:
string.format("<a href='http://localhost:2386/ActivateUser.aspx?userName{0}&Id={1}'>Activate {0} </a>{2}", 
UName, user_name,someothervalue)
于 2012-04-05T21:12:18.597 回答
0

像这样的东西?

var values = new Dictionary<string,string>{ 
                                                {"username", user_name},
                                                {"id", UName},
                                                {"otherparam", "lalala"}
                                         };

var queryString = string.Join("&" + values.Select(x => x.Key + "=" + x.Value));

var link = string.format("<a href='http://localhost:2386/ActivateUser.aspx?{0}'>Activate {1} </a>", queryString, user_name);
于 2012-04-05T21:16:58.527 回答