大家看下我这样处理行不?如下:
    public class Common
    {
        public static string Request(string ParameterName)
        {
            string Content = System.Web.HttpContext.Current.Request[ParameterName];
            Content = Content.Replace("'", "''");//将单引号替换成2个单引号
            Content = Content.Replace("<", "&lt;");//将“<”符号转义
            Content = Content.Replace(">", "&gt;");//将“>”符号转义
            return Content;
        }
    }然后在调用的地方,如下:
string UserName = Common.Request("username");
这样可行?请大牛、小菜们多多指点,多谢!