File Directory ASP.Net Tutorial

<%@ Page Language="C#" %>
<%@ Import Namespace="System.IO" %>


    protected void Page_Load(object sender, EventArgs e)
    {
        BinaryWriter binarywriter = new BinaryWriter(File.Create(@"Data.dat"));
        binarywriter.Write("a string");
        binarywriter.Write(0x12346789abcdef);
        binarywriter.Write(0x12345678);
        binarywriter.Write('c');
        binarywriter.Write(1.5f);
        binarywriter.Write(100.2m);
        binarywriter.Close();
        BinaryReader binaryreader = new BinaryReader(File.Open(@"Data.dat", FileMode.Open));
        string a = binaryreader.ReadString();
        long l = binaryreader.ReadInt64();
        int i = binaryreader.ReadInt32();
        char c = binaryreader.ReadChar();
        float f = binaryreader.ReadSingle();
        decimal d = binaryreader.ReadDecimal();
        binaryreader.Close();
    }



    Untitled Page