Jul 18, 2005 #1 fly231 Programmer May 29, 2005 24 GB Hi , Can anyone tell me how to read contents of an aspx file. Like avoiding the tags and reading just the content ? Any help would be greatly appreciated. Thanks.
Hi , Can anyone tell me how to read contents of an aspx file. Like avoiding the tags and reading just the content ? Any help would be greatly appreciated. Thanks.
Jul 18, 2005 Thread starter #2 fly231 Programmer May 29, 2005 24 GB By the way, forgot to mention, this is for a simple website search. Thanks. Upvote 0 Downvote
Jul 18, 2005 #3 checkai Programmer Jan 17, 2003 1,629 US i would think it's the same as reading any other HTML page...because .aspx pages still render things as HTML objects... "...we both know I'm training to become a cagefighter...see what happens if you try 'n hit me..." Upvote 0 Downvote
i would think it's the same as reading any other HTML page...because .aspx pages still render things as HTML objects... "...we both know I'm training to become a cagefighter...see what happens if you try 'n hit me..."
Jul 18, 2005 Thread starter #4 fly231 Programmer May 29, 2005 24 GB I used string filePath = "c:\\inetpub\\http://wwwroot\\temp\\tempFile.aspx"; FileStream file = File.OpenRead(filePath); StreamReader sr = new StreamReader(file); string strTemp = sr.ReadToEnd(); pattern = @"<(.|\n)*?>"; string StripdText = Regex.Replace (strTemp,pattern,string.Empty); This works with an HTML file but not with aspx file cause it doesn't strip off the <script> tags. Can someone please tell me how to get rid of all the tags. and also the extra white spaces. Thanks. Upvote 0 Downvote
I used string filePath = "c:\\inetpub\\http://wwwroot\\temp\\tempFile.aspx"; FileStream file = File.OpenRead(filePath); StreamReader sr = new StreamReader(file); string strTemp = sr.ReadToEnd(); pattern = @"<(.|\n)*?>"; string StripdText = Regex.Replace (strTemp,pattern,string.Empty); This works with an HTML file but not with aspx file cause it doesn't strip off the <script> tags. Can someone please tell me how to get rid of all the tags. and also the extra white spaces. Thanks.