request.Cookies("g365")("username")<>null

解决方案 »

  1.   

    照114的写法提示:编译器错误信息: BC30822: “null”未声明。不再支持“Null”常数;请改用“System.DBNull”。
      

  2.   

    你自己没有说明你的Cookies存储的是数据库字段
      

  3.   

    if request.Cookies("g365")("username")<>Nothing then
      

  4.   

    request.Cookies("g365")("username")<>String.Empty
    try!
      

  5.   

    xrascal(横刀夺爱)的方法一样提示:
    System.NullReferenceException: 未将对象引用设置到对象的实例。如果有值的话,则不会提示出错。
    但是如果是中文值的话,则显示%CB%A7%BA等字样。
      

  6.   

    if (request.Cookies("g365")("username")<>Nothing) and ( request.Cookies("g365")("username")<>"") then纠正:null在C#中用的。