Login | Register  

Writing binary files using BinaryWriter

by Scud   Monday, October 02, 2006 Rating:
 Vote this news:


In this source code we will look at anyother new focus on ASP.NET. We could write binay files using BinaryWriter class. Let's see it on a sample code.



public bool writeFile2Dsick(string strFilePath, byte[] strBinaryFile)
{
        bool writtenFile = true;

        try
        {
                using (FileStream objFileSystem = new FileStream(strFilePath, FileMode.CreateNew))
                {
                    using (BinaryWriter objBinaryWriter = new BinaryWriter(objFileSystem))
                    {
                        objBinaryWriter.Write(strBinaryFile);
                    }
                }
        }
        catch (IOException e)
        {
                writtenFile = false;
        }

        return writtenFile;
}




Dotnetindex.com is listed with 411asp.net
Dotnetindex.com is listed with aspin.com
Dotnetindex.com is listed with jspin.com
PHP, ASP, .NET, JSP Resources, Reviews







page counter
Copyright © 2007 Powered by GNews Publisher Positive. All rights reserved. Contact Us - Load Time: 0.09 second(s)