Illegal characters in path

Dec 3, 2009 at 9:10 PM

debug info:

_COMPlusExceptionCode = -532459699

 

at System.IO.Path.CheckInvalidPathChars(String path)
   at System.IO.Path.GetFileName(String path)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
   at System.IO.StreamReader..ctor(String path, Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize)
   at System.IO.StreamReader..ctor(String path, Encoding encoding)
   at HtmlAgilityPack.HtmlDocument.Load(String path)
   at HortonPoll._Default.GetTable(String rslt) in C:\work\VS2008\Test\HortonPoll\HortonPoll\HortonPoll\Default.aspx.cs:line 104
   at HortonPoll._Default.LinkButton1_Click(Object sender, EventArgs e) in C:\work\VS2008\Test\HortonPoll\HortonPoll\HortonPoll\Default.aspx.cs:line 56

code:

HtmlAgilityPack.HtmlDocument doc = new HtmlAgilityPack.HtmlDocument();
doc.Load(rslt);
HtmlAgilityPack.HtmlNodeCollection table = doc.DocumentNode.SelectNodes("//table");

....bombs at doc.Load(). I can't figure out what it doesn't like. The provided markup renders in the browser as expected.

 

<html><head><meta http-equiv="Content-type" content="text/
html;charset=UTF-8" />

<script>function Send() {if(document.mainForm.htmlArea &&
 document.mainForm.htmlArea.value) {var rawHtml =
 document.mainForm.htmlArea.value;if(rawHtml) {var htmlContainerObj
 = false;htmlContainerObj = parent.document.getElementById
 ("hortonQV_Content");htmlContainerObj.innerHTML = rawHtml;}}return
 (true);}</script></head><body onload="Send()">
 <form name="mainForm">
 <textarea id="htmlArea" cols="200" rows="200" >
 <div class="hortonQVQuest">What Is Your Finish Of Choice For An
 Automatic Door?</div>
 <table cellpadding="0" cellspacing="0">
 <tr class="hortonQVAns1"><td class="hortonQVcell">Anodized
 Aluminum</td><td class="hortonQVpercent">37%</td><td
 class="hortonQVTotal">14,539</td></tr><tr class="hortonQVAns2"><td
 class="hortonQVcell">Powdercoat Paint</td><td
 class="hortonQVpercent">28%</td><td class="hortonQVTotal">11,287</
 td></tr><tr class="hortonQVAns3"><td class="hortonQVcell">Steel</
 td><td class="hortonQVpercent">35%</td><td
 class="hortonQVTotal">13,895</td></tr><tr><td
 class="hortonQVTotalSum" colspan="3">Total Votes: 39,721</td></tr></
 table> </textarea> </form></body></html>

 

 

Dec 3, 2009 at 9:13 PM

Load expects a path to a file

I think you want to use doc.LoadHtml instead

Dec 3, 2009 at 9:13 PM

Right, Thanks!!!!