有如下的代码:public static int GetIntFromQueryString(HttpContext context, string key)
{
int returnValue = -1;
string queryStringValue; // Attempt to get the value from the query string
//
queryStringValue = context.Request.QueryString[key]; // If we didn't find anything, just return
//
if (queryStringValue == null)
return returnValue; // Found a value, attempt to conver to integer
//
try
{
// Special case if we find a # in the value
//
if (queryStringValue.IndexOf("#") > 0)
queryStringValue = queryStringValue.Substring(0, queryStringValue.IndexOf("#")); if (queryStringValue.IndexOf(",") > 0)
queryStringValue = queryStringValue.Substring(0, queryStringValue.IndexOf(",")); returnValue = Convert.ToInt32(queryStringValue);
}
catch
{
} return returnValue; }=======================================
这句queryStringValue = context.Request.QueryString[key]; 到底是想干什么那?也查不到httpcontext.request下还有querystring啊
{
int returnValue = -1;
string queryStringValue; // Attempt to get the value from the query string
//
queryStringValue = context.Request.QueryString[key]; // If we didn't find anything, just return
//
if (queryStringValue == null)
return returnValue; // Found a value, attempt to conver to integer
//
try
{
// Special case if we find a # in the value
//
if (queryStringValue.IndexOf("#") > 0)
queryStringValue = queryStringValue.Substring(0, queryStringValue.IndexOf("#")); if (queryStringValue.IndexOf(",") > 0)
queryStringValue = queryStringValue.Substring(0, queryStringValue.IndexOf(",")); returnValue = Convert.ToInt32(queryStringValue);
}
catch
{
} return returnValue; }=======================================
这句queryStringValue = context.Request.QueryString[key]; 到底是想干什么那?也查不到httpcontext.request下还有querystring啊
ex:客户端
http://www.xxx.com/?id = xxx
queryStringValue = context.Request.QueryString["id"] 是 xxx
http://community.csdn.net/Expert/topic/5153/5153847.xml?temp=.5339929
queryStringValue = context.Request.QueryString["temp"]; //输出.5339929