© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•2y ago•
4 replies
Kaygee

Convert a Binary string to a file

Hello Guys,

I created this code which convert a text file to be copied into a image field in SQL server

FileStream stream = new FileStream(filePath, FileMode.Open, FileAccess.Read);
BinaryReader reader = new BinaryReader(stream);

byte[] Fichier = reader.ReadBytes((int)stream.Length);
reader.Close();
stream.Close();

return Fichier;


How can I do the inverse ?

I would get the binary from sql and copy content into a file

Thanks
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Process Binary String
C#CC# / help
7mo ago
✅ Finding the position of a string in a binary file
C#CC# / help
4y ago