|
-
Apr 11th, 2002, 03:18 PM
#1
Writing to a file
Can someone please help me figure out how to write to a file. I am using the binarywriter right now but this is giving me weird out put. take a look at the sample code below:
string outputFile = "csharp.htm";
string path = "c:/";
FileStream output;
output = new FileStream( path + outputFile, FileMode.OpenOrCreate, FileAccess.Write);
BinaryWriter binaryOutput = new BinaryWriter(output);
binaryOutput.Write("<html>\n<head>\n<title>C#!</title>\n</head><body>\n");
Thats jsuta tid bit there is actually more code ot it but that is the essentials. This gie me weird output with either one of those block characters or a random slash or somethign else at the beginning of every .Write("something") i do.
can anyone help?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|