Skip to content

Instantly share code, notes, and snippets.

View jcouture100's full-sized avatar

John Couture jcouture100

  • Omaha, NE
View GitHub Profile
@wantedfast
wantedfast / C#字符和Stream之间的转换
Last active June 24, 2025 20:10
C# Convert String to Stream, and Stream to String
**Convert String to Stream**
To convert a C# String to a MemoryStream object, use the GetBytes Encoding method to create a byte array, then pass that to the MemoryStream constructor:
- byte[] byteArray = Encoding.ASCII.GetBytes( test );
- MemoryStream stream = new MemoryStream( byteArray );
**Convert Stream to String**
To convert a Stream object (or any of its derived streams) to a C# String, create a StreamReader object, then call the ReadToEnd method:
- StreamReader reader = new StreamReader( stream );
@rafaelsc
rafaelsc / VisualStudio.flt
Created May 6, 2015 22:07
WinMerge Directory/File Filter for Visual Studio temporary files, build results, and files generated by popular Visual Studio add-ons.
## by rafaelsc
## This is a directory/file filter for WinMerge
## This filter Ignore Visual Studio temporary files, build results, and files generated by popular Visual Studio add-ons
name: Visual Studio Files
desc: Ignore Visual Studio temporary files, build results, and files generated by popular Visual Studio add-ons.
## This is an inclusive (loose) filter
## (it lets through everything not specified)
def: include