new.html的内容如下:
<table width='100%' cellspacing='0' cellpadding='2'>
<tr>
<td align='center' style='background-color: #18B5F0' colspan = '2'><b>Order Sheet</b></td>
</tr>
<tr>
<td colspan = '2'></td>
</tr>
<tr>
<td><b>Order No:</b> 100</td>
<td><b>Date: </b>7/3/2016 12:51:00 AM </td>
</tr>
<tr>
<td><b>From :</b> Company Name </td>
<td><b>To: </b> Some Company </td>
</tr>
</table>
<table border = '1'>
<tr>
<th style = 'background-color: #D20B0C;color:#ffffff'>Id</th>
<th style = 'background-color: #D20B0C;color:#ffffff'>Name</th>
<th style = 'background-color: #D20B0C;color:#ffffff'>Country</th>
</tr>
<tr>
<td>1</td>
<td>John Hammond</td>
<td>United States</td>
</tr>
<tr>
<td>2</td>
<td>Mudassar Khan</td>
<td>India</td>
</tr>
<tr>
<td>3</td>
<td>Suzanne Mathews</td>
<td>France</td>
</tr>
<tr>
<td>4</td>
<td>Robert Schidner</td>
<td>Russia</td>
</tr>
</table>
我正在使用Aspose Cells for .NET版本8.8.1.0和
这是我的代码段:
Workbook workbook = new Workbook();
workbook= new Workbook(@"C:\new.html");
引发类型System.FormatException
的异常,异常详情如下:
数据:{System.Collections.ListDictionaryInternal}
HResult:-2146233033
HelpLink:null
InnerException:null
消息:“输入字符串的格式不正确。”
资料来源:“mscorlib”
StackTrace:“System.Number.StringToNumber(String str,NumberStyles options,NumberBuffer&amp; number,NumberFormatInfo info,Boolean parseDecimal)\ r \ n在System.Number.ParseInt32(String s,NumberStyles style,NumberFormatInfo info)\ r \ n at System.Convert.ToInt32(String value)\ r \ n at \ u0003。\ u0002(Hashtable \ u0002,String \ u0003)\ r \ n at \ u0005。\ u0002(String \ u0002,ArrayList \ u0003)\ r \ n \ n位于\ u0003。\ b()\ r \ n位于\ u0003。\ u0002()\ r \ n位于\ u0005。\ u0002(Stream \ u0002)\ r \ n位于\ u0005。\ Aspose.Cells.Workbook。\ u0002(String \ u0002,LoadOptions \ u0003)\ u \ n在Aspose.Cells.Workbook..ctor(String file)中的u0002(String \ u0002)\ r \ n“ TargetSite:{Void StringToNumber(System.String,System.Globalization.NumberStyles,NumberBuffer ByRef,System.Globalization.NumberFormatInfo,Boolean)}