Compiler warning: null reference exception

前端 未结 3 844
盖世英雄少女心
盖世英雄少女心 2021-01-18 14:39

I have the following code in Visual Studio 2005.

    Dim OutFile As System.IO.StreamWriter
    Try
        OutFile = New System.IO.StreamWriter(Filename)
            


        
3条回答
  •  温柔的废话
    2021-01-18 15:09

    Its a question of scope, the initialisation of the outfile object is happening in a block of code not visible to the fianlly block.

提交回复
热议问题