大家看下我这样处理行不?如下:
public class Common
{
public static string Request(string ParameterName)
{
string Content = System.Web.HttpContext.Current.Request[ParameterName];
Content = Content.Replace("'", "''");//将单引号替换成2个单引号
Content = Content.Replace("<", "<");//将“<”符号转义
Content = Content.Replace(">", ">");//将“>”符号转义
return Content;
}
}然后在调用的地方,如下:
string UserName = Common.Request("username");
这样可行?请大牛、小菜们多多指点,多谢!
public class Common
{
public static string Request(string ParameterName)
{
string Content = System.Web.HttpContext.Current.Request[ParameterName];
Content = Content.Replace("'", "''");//将单引号替换成2个单引号
Content = Content.Replace("<", "<");//将“<”符号转义
Content = Content.Replace(">", ">");//将“>”符号转义
return Content;
}
}然后在调用的地方,如下:
string UserName = Common.Request("username");
这样可行?请大牛、小菜们多多指点,多谢!
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货