StringBuilder str = new StringBuilder();
str.Append("<table class='isTable'><tr><th></th><th>用户名</th><th>webservices地址</th><th>webservices方法名称</th></tr>");
AppSettingsReader reader =
new AppSettingsReader();
NameValueCollection appStgs =
ConfigurationManager.AppSettings;
string[] names =
ConfigurationManager.AppSettings.AllKeys;
String value = String.Empty;
for (int i = 0; i < appStgs.Count; i++)
{
string key = names[i];
if (key.IndexOf("WebSiteUser") >= 0)
{
value = (String)reader.GetValue(key, value.GetType());
string[] strValue = value.Split(',');
string webservices = strValue[0];
string method = strValue[1];
str.Append("<tr><td><a style='color:White;text-decoration: none;' href=\"/sdmin/EditWebSiteUser?key=" + key + "\"><img src='../../Content/icons/admin_edit.png' alt='' title='编辑'/></a></td><td>" + key.Replace("WebSiteUser", "") + "</td><td>" + webservices + "</td><td>" + method + "</td></tr>");
}
}
str.Append("</table>");
ViewData["ListWebSiteUser"] = str;
return View();