代码看不懂,请大神们解答解决方案
代码看不懂,请大神们解答

if (!int.TryParse(Request.Params["classId"] as string, out this.classId))
{
this.classId = 0;
}
主要是out关键字看不懂,希望大神详细解答。
------解决思路----------------------
if (!int.TryParse(Request.Params["classId"] as string, out this.classId))
{
this.classId = 0;
}
就是能不能将Request.Params["classId"] 转换成int,能则给符值给当前类的classId,不能就给classid付值为0。
out 出不进,定义时classid不用给值!
------解决思路----------------------
out 表示传递的是引用,方法中可直接修改该参数,而无需返回
------解决思路----------------------
ref out,查下msdn呗
https://msdn.microsoft.com/zh-cn/library/t3c3bfhx.aspx
if (!int.TryParse(Request.Params["classId"] as string, out this.classId))
{
this.classId = 0;
}
主要是out关键字看不懂,希望大神详细解答。
------解决思路----------------------
if (!int.TryParse(Request.Params["classId"] as string, out this.classId))
{
this.classId = 0;
}
就是能不能将Request.Params["classId"] 转换成int,能则给符值给当前类的classId,不能就给classid付值为0。
out 出不进,定义时classid不用给值!
------解决思路----------------------
out 表示传递的是引用,方法中可直接修改该参数,而无需返回
------解决思路----------------------
ref out,查下msdn呗
https://msdn.microsoft.com/zh-cn/library/t3c3bfhx.aspx