DiigIT | IT Community
No Profile Image
Welcome Guest
New User? Register | Login

How to write on randomly

By: rekha singh | 17 Feb 2010 1:13 pm

Hi everyone;

I am in a trouble that i want to write text in a text file on a random locations... ......... .e.g that i want to write any text on a text file at any location giving its column and row value or coordinates or their exact cursor position using c#.net....so every one is requested to plz help me in this regard;

Regards;

 

Comments

Use StreamWriter class (System.IO.StreamWr iter) for writing data to a text file. Pass file name along with full path (location) into constructor when creating StreamWriter' s object.

StreamWriter _writer = new StreamWriter( "C:\\Test. txt");

I don't know exactly how to write data to text file in specific or random locations. Perhaps you can find a solution by googling it or may be you have to write customized methods for doing this. For example, as you said "....i want to write any text on a text file at any location giving its column and row value or coordinates or their exact cursor position...". Seems that you have to insert your desired data/text in middle of existing text in a file. May be you can read the content of file first, then insert your desired string or data using String class and then rewrite data to file. Do let us know if you find any other yet effective and optimized solution for this. I will post if I find any.

Thanks.

 

By: rekha singh | 18 Feb 2010

Leave a comment

Enter the text in the image
img
Can't read?
Type the characters you see in the picture below.


Close Move