how to call text file in to c#.net2008
Hai..... i having text file it contain script ,how can i use this text file in to my c#
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
VulpesPosted Jun 27, 2013, 2:30 AM
using System.IO:
// ....
string text = File.ReadAllText("somefile.txt");
// or if you want it in lines:
string[] lines = File.ReadAllLines("somefile.txt");
Sarika Nikam NikamPosted Jun 27, 2013, 1:54 AM
Suthish NairPosted Apr 5, 2011, 12:45 PM
Prabhakar PariharPosted Apr 4, 2011, 7:47 AM
Check this Link It's a use full for You , .
http://www.dotnetfunda.com/articles/article1169-read-all-notepad-files-in-a-folder-and-merge-all-notepad-files-data-in-as-.aspx
VulpesPosted Apr 3, 2011, 6:59 AM
using System.IO;
//...
string oldPath = "myfile.txt";
string newPath = Path.GetFileNameWithoutExtension(oldPath) + ".js";
File.Move(oldPath, newPath);
Sam HobbsPosted Apr 2, 2011, 8:18 PM
VulpesPosted Apr 2, 2011, 6:40 AM