Returns a stream when given a string
Public Function ToStream(ByVal Source As String) As System.IO.MemoryStream
Dim Bytes() As Byte = System.Text.Encoding.ASCII.GetBytes(Source)
Return New System.IO.MemoryStream(Bytes)
Dim MyStream as Stream = "Fred".ToStream
ExtensionMethod.NET was built by
Loek van den Ouweland and Fons Sonnemans
By using this website, you agree to the legal stuff.
We thank all who contributed to this website for the last twelve years. It really helped making this website a success!
Just looking for examples? Visit our sister site
Looking for Visual Studio Code Snippets? Visit our sister site VisualStudioCodeSnippets.com.