A
Atara
Suppose I have the following functions:
Public Function myF1ToStream(...) As System.IO.MemoryStream
. . .
Dim ms As New System.IO.MemoryStream(buf)
Return ms
End Function
Public Function mcF2ToXml(. . .) As Xml.XmlDocument
. . .
Dim xmlDoc As New Xml.XmlDocument
xmlDoc.Load(ms)
Return xmlDoc
End Function
When I call these functions, which of the following lines marked with
('?) is necessary?
(I use vs2003, without 'Using' keyword. )
Dim ms As System.IO.MemoryStream = myF1ToStream(...)
'? ms.Seek(0, System.IO.SeekOrigin.Begin)
. . . ms.ReadByte() . . .
'? ms.Close()
'? ms = Nothing
Dim xmlDoc As XmlDocument = mcF2ToXml(...)
. . . myUse(xmlDoc) . . .
'? xmlDoc = Nothing
Thanks,
Atara
Public Function myF1ToStream(...) As System.IO.MemoryStream
. . .
Dim ms As New System.IO.MemoryStream(buf)
Return ms
End Function
Public Function mcF2ToXml(. . .) As Xml.XmlDocument
. . .
Dim xmlDoc As New Xml.XmlDocument
xmlDoc.Load(ms)
Return xmlDoc
End Function
When I call these functions, which of the following lines marked with
('?) is necessary?
(I use vs2003, without 'Using' keyword. )
Dim ms As System.IO.MemoryStream = myF1ToStream(...)
'? ms.Seek(0, System.IO.SeekOrigin.Begin)
. . . ms.ReadByte() . . .
'? ms.Close()
'? ms = Nothing
Dim xmlDoc As XmlDocument = mcF2ToXml(...)
. . . myUse(xmlDoc) . . .
'? xmlDoc = Nothing
Thanks,
Atara