66

I have a base64 encoded string.

How can I write this base64 encoded string to a file?

p.campbell
  • 95,348
  • 63
  • 249
  • 319
JL.
  • 75,548
  • 121
  • 304
  • 451

2 Answers2

153

Try this:

File.WriteAllBytes(@"c:\yourfile", Convert.FromBase64String(yourBase64String));
Rubens Farias
  • 55,782
  • 8
  • 132
  • 160
2

As a first pointer, check out MSDN's documentation on the XmlTextreader's ReadBase64 Method... http://msdn.microsoft.com/en-us/library/system.xml.xmltextreader.readbase64.aspx

flq
  • 21,553
  • 6
  • 53
  • 76