我已经阅读了 msdn文档 中的此代码:
Stream myStream = null;
OpenFileDialog openFileDialog1 = new OpenFileDialog();
[...] // Some init
try
{
if ((myStream = openFileDialog1.OpenFile()) != null)
{
using (myStream)
{
// Insert code to read the stream here.
}
}
}
但是Resharper温柔地告诉我,检查null是无用的:
我应该信任Resharper还是Microsoft?