Click here to Skip to main content
16,021,687 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
i had created a text file using file stream writer . i want to draw some lines(colored) in that text file. can anyone please help me?

C#
fileStreamreader = new FileStream(filePath, FileMode.Open, FileAccess.ReadWrite);
try
{
    int length = (int)fileStreamreader.Length;
    buffer = new byte[length];
    fileStreamreader.Read(buffer, 0, buffer.Length);
    fileStreamreader.Close();

}
catch (Exception ex)
{
    MessageBox.Show(ex.ToString());
}
Posted
Updated 7-Dec-11 19:52pm
v2

Amazing question! Files have no colors, lines, nothing. They just consist of bytes. Well, a text file can be served as a media for some graphical formats (XML-based, for example), but the question is certainly not related to this topic.

—SA
 
Share this answer
 
v2
Comments
narutoluffy01 8-Dec-11 2:05am    
the thing is i was told to open a .dgn file and draw some lines in .dgn. i found no related topics on that so i asked the requirement in .txt
Sergey Alexandrovich Kryukov 8-Dec-11 2:24am    
Makes no sense at all. You next question is also irrelevant. Reading/writing and parsing/generation of graphics are unrelated things. Also, you ask about writing but show the use of StreamReader. What's wrong with you?
--SA
Mehdi Gholam 8-Dec-11 2:17am    
5'ed
Sergey Alexandrovich Kryukov 8-Dec-11 2:25am    
Thank you, Mehdi.
--SA
Text files by their nature are just text. Formatting and colours are part of a file format designed for rich documents.

So you can't have coloured lines in a text file.
 
Share this answer
 
Comments
narutoluffy01 8-Dec-11 2:05am    
the thing is i was told to open a .dgn file and draw some lines in .dgn. i found no related topics on that so i asked the requirement in .txt

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900