i have pasted the code snippet which am using here....
StreamReader sr = File.OpenText(G:\\HtmlReports\\Original.htm);
string input = sr.ReadToEnd();
input = input.Trim();
StreamWriter strWriter = new StreamWriter("G:\\HtmlReports\\ReplacedHtm.htm");
strWriter.Write(input);
The junk values which am able to see in the browser is
"���� " or sme other format...
the html file has space in betwen to beautify the document namely " (a)<span style='mso-spacerun:yes'> </span>Apple</span>" and whn i read this file through streamreader the space ie betwn "'mso-spacerun:yes'>" and "</span>"is encoded in to these junk values ..hence am geting these junk values..
So do you kno any means to remove them ??
thanx
Well, the whitespace didn't matter in my test... I always was able to get the html document without the junk.
If all you're doing is moving one file to another location, .NET has a method to do that which is much more efficient than writing the file yourself.
But anyway, I would suspect that those spaces are actually characters that can't be displayed by your editor (though usually, it's been my experience that they at least display *something*--usually a smiley face or something). The quickest way to test this theory is go back to your editor and delete all the "whitespace" where you're getting the junk and replace it with spaces or tabs. If you're still getting the junk, you'll want to watch the input variable after you've read the document, to see if it's getting read correctly.
Come back if you still get junk.