A
adamrobillard
I am very new to vb.net and am using Visual Basic 2005 Express Edition.
This is my function that essentially looks at a directory to see if it
is valid:
'Local variables
Dim sDirectory As System.IO.Directory
'See if path is valid
If sDirectory.Exists(Me.txtFilePath.Text) Then
FillList()
Else
Me.lstFoundFiles.Items.Clear()
End If
This works fine but I am confused by the warning messages I am getting:
Warning 1 - Unused local variable: 'sDirectory'.
Warning 2 - Access of shared member, constant member, enum member or
nested type through an instance; qualifying expression will not be
evaluated.
Now the local variable is being used and appears to be working because
when my text box (txtFilePath) is invalid the list is cleared and when
it is valid my FillList method is called. I am not sure what Warning 2
means.
Can anyone shed a little light on this?
This is my function that essentially looks at a directory to see if it
is valid:
'Local variables
Dim sDirectory As System.IO.Directory
'See if path is valid
If sDirectory.Exists(Me.txtFilePath.Text) Then
FillList()
Else
Me.lstFoundFiles.Items.Clear()
End If
This works fine but I am confused by the warning messages I am getting:
Warning 1 - Unused local variable: 'sDirectory'.
Warning 2 - Access of shared member, constant member, enum member or
nested type through an instance; qualifying expression will not be
evaluated.
Now the local variable is being used and appears to be working because
when my text box (txtFilePath) is invalid the list is cleared and when
it is valid my FillList method is called. I am not sure what Warning 2
means.
Can anyone shed a little light on this?