From the problem to language game

xiaoxiao2021-03-06  49

Today, I have a classmate to ask me, why the following code will go wrong if (Request.Cookies [""] ["email"] == null) {// code} error message is: Unlike an object to instance this code I will definitely go wrong, I believe that there is an experienced friend to see how it is going to have anything if Request.Cookies ["users"] == null, can there be Email this subtribracothe? Change this will not have an error: if (Request.Cookies ["Users"]! = Null && Request.cookies ["Users"] ["email"]! = Null) {} else {// code} feel above The code has a {} area excess, so: if (Request.cookies ["Users"]! = Null) {if (Request.Cookies ["Users"] ["email"] == null) {// code }} But there is another nest, so: if (! ((! (! ")! = Null && request.cookies [" Users "] [" email "]! = Null) {// This logic seems to be not good ...

转载请注明原文地址:https://www.9cbs.com/read-115791.html

New Post(0)