当前位置:网站首页>c# 解决CS8602告警 解引用可能出现空引用
c# 解决CS8602告警 解引用可能出现空引用
2022-08-10 01:18:00 【ou.cs】
!
null 容忍操作符(null-forgiving operator)
官方文档:! (null-forgiving) operator (C# reference) The compiler warns
that you may be dereferencing null when you write the property
message.Length because its static analysis determines that message may
be null. You may know that IsNotNull provides a null check, and when
it returns true, the null-state of message should be not-null. You
must tell the compiler those facts. One way is to use the null
forgiving operator, !. You can change the WriteLine statement to match
the following code:
它的主要作用就是告诉编译器,变量不可能为 null。
边栏推荐
- shell指定参数名传参
- Sikuli 基于图形识别的自动化测试技术
- hint: Updates were rejected because the tip of your current branch is behind hint: its remote counte
- GB28181 sip和RTSP(Real-Time Streaming Protocol)实时流控制协议
- eyb:Redis学习(4)
- OptiFDTD应用:纳米盘型谐振腔等离子体波导滤波器
- 免费文档翻译软件电脑版软件
- 进程管理和任务管理
- 用于X射线光学器件的哈特曼波前传感器
- Linux(Centos7)服务器中配置Mysql主从数据库,以及数据库的安装,防火墙操作
猜你喜欢
随机推荐
彩色袜子题
unity编辑器扩展界面使用 List
Solidity最强对手:MOVE语言及新公链崛起
华为HCIE云计算之FC添加ipsan数据存储
hint: Updates were rejected because the tip of your current branch is behind hint: its remote counte
五种定位——粘性定位
[网鼎杯 2020 青龙组]AreUSerialz
【wpf】自定义事件总结(Action, EventHandler)
力扣每日一题-第51天-744. 寻找比目标字母大的最小字母
微信小程序tab切换时保存checkbox状态
首次在我们的centos登录我们的Mysql
The shell specifies the parameter name to pass the parameter
浏览器中的history详解
【wpf】拖拽的简单实现
Pyscript,创建一个能执行crud操作的网页应用
Premint工具,作为普通人我们需要了解哪些内容?
卷积神经网络识别验证码
【报错】ModuleNotFoundError: No module named ‘paramiko‘
【干货】集成学习原理总结
22.括号生成