I have one function ParseHtmlTable(string htmlContent).
Now in that function I want to pass the content of the html file. Now can I do by writing only filename with its path.Then I have to read that file.But I dont how to read this file ?
Then how to open particular file and read the contents of the file and send those contents to parameter of the function ?
EDIT : System.IO.File.ReadAllText(path) can read all the html file but there is one file whic开发者_开发知识库h I have it is not read through this function.What is the reason can be there ? And for that what can be the solution ?
Have you tried using
string s = System.IO.File.ReadAllText( path );
File.ReadAllText Method (String)
EDIT to comment
To itterate the files in a directory you can try using Directory.GetFiles Method (String)
foreach (string filename in Directory.GetFiles(path))
{
//do what you need here
}
精彩评论