本帖最后由 wenxiaobo1988 于 2013-08-03 11:59:02 编辑

解决方案 »

  1.   

    Convert.ToInt32(name)
    name是用户名  例如:wenxiaobo1988  你怎么可以转成Int类型的?
      

  2.   

    name无法转换成正常数字
    string name = HttpContext.Current.User.Identity.Name;
                int temp = 0;
                return HttpContext.Current.User.Identity.IsAuthenticated ? int.TryParse(name, out temp) ? temp : 0 : 0;