Read Text File, populate HTML TextArea

I have a tab delimited text file.  I want to open up an HTML page and take this text file and populate a text area in that  HTML page. How do I go about doing this?
MichelleLacyAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
MichelleLacyConnect With a Mentor Author Commented:
I found the solution:
1st using C# FileStream open file, then read it:
FileStream fileStream = new FileStream(@"c:\file.txt", FileMode.Open, FileAccess.Read);
Then set up an event to copy the text to the clipboard Clipboard.SetText(txtClipboard.Text), then ...whatever.Text = Clipboard.GetText();

Finally I found a method in Javascript, but I bet you can do it in C# as well, buyt this seemed more straightforward.  Open the URL link, grab the text from the clipboard and paste into into the textarea of the html page
<script type="text/javascript">
function PasteFromClipboard()

{

   document.Form1.txtArea.focus();

   PastedText = document.Form1.txtArea.createTextRange();

   PastedText.execCommand("Paste");

}

</script>
 
0
 
anarki_jimbelCommented:
Where is you file is located?

You can't read a file on a clien computer from the page (through code).
0
 
MichelleLacyAuthor Commented:
The file will be saved in My Documents.
0
 
anarki_jimbelCommented:
OK, I don't understand. You want to OPEN a file on a client computer? Or you want to SAVE it?
Anyway, as I already told, keep in mind that you can't read/write files on a client computer.
0
 
MichelleLacyAuthor Commented:
The program will run a user's computer.  The user has save a file in a specified format on their computer.  The program will look for this file, read the contents and paste it into a text area.  So let's say I am the user.   The text file is on my computer.  I have a text file with two columns.  I want to copy the contents of this file and paste it into a text area of an html page.
 
0
All Courses

From novice to tech pro — start learning today.