the error obtained is like the following
"the Entry path name is not legal"
What does it mean & canu explain this problem & find a solution for the reading of document file like doc,docx etc using C# language
Loading
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
FroglegRank #1,020 · 1.9K reputationPosted Feb 16, 2012, 8:19 PM EST
should be
StreamReader objreader = new StreamReader(path);
Path.GetExtension will get a file extension - ie:
Path.GetExtension("test.txt");
will return ".txt"
Aditya Varma Mudunuri56 reputationPosted Feb 16, 2012, 9:04 PM EST
Please Provide me a solution for this issue
Pramod Kumar NandagiriRank #6,963 · 252 reputationPosted Feb 16, 2012, 10:30 PM EST
string path = @"C:\SUBS\Employee\156 Useful Run Commands";
what is "156 Useful Run Commands", if this is a file name then it's extension must have to be provided.
ex: string path = @"C:\SUBS\Employee\156 Useful Run Commands.txt";
(or)
string path = @"C:\SUBS\Employee\156 Useful Run Commands.docx";
Provide extension in the path and change "Path.GetExtension(path)" to "Path" as said by "Mr Frogleg "
StreamReader objreader = new StreamReader(Path);
then u will get no error
Aditya Varma Mudunuri56 reputationPosted Feb 16, 2012, 10:50 PM EST
Suthish NairRank #92 · 22.8K reputationPosted Feb 19, 2012, 9:38 AM EST