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.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
VulpesRank #55 · 29.2K reputationPosted Apr 2, 2011, 2:40 AM EDT
Sam HobbsRank #107 · 20.5K reputationPosted Apr 2, 2011, 4:18 PM EDT
VulpesRank #55 · 29.2K reputationPosted Apr 3, 2011, 2:59 AM EDT
using System.IO;
//...
string oldPath = "myfile.txt";
string newPath = Path.GetFileNameWithoutExtension(oldPath) + ".js";
File.Move(oldPath, newPath);
Prabhakar PariharRank #1,307 · 1.3K reputationPosted Apr 4, 2011, 3:47 AM EDT
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
Suthish NairRank #92 · 22.8K reputationPosted Apr 5, 2011, 8:45 AM EDT
Sarika Nikam Nikam5 reputationPosted Jun 26, 2013, 9:54 PM EDT
VulpesRank #55 · 29.2K reputationPosted Jun 26, 2013, 10:30 PM EDT
using System.IO:
// ....
string text = File.ReadAllText("somefile.txt");
// or if you want it in lines:
string[] lines = File.ReadAllLines("somefile.txt");