有一个静态网页 如下:
<html>
<head>
<title>ECP-DEMO</title>
</head>
<body style="margin:0 0 0 0;">
<table id="tab" border="1" style=" background-color:Black; border-width:1px; border-color:Red;color:Red;height:14px;font-family:宋体;font-size:16px;">
<tr>
<td>
今天是2010年8月11日星期三 阴历 七月初二。今日天气: 24 ℃ /32 ℃ 阴转多云 风向/风力: 微风 明日天气: 24 ℃ /29 ℃ 多云转雷阵雨 风向/风力: 微风 。
</td>
</tr>
</table>
</body>
<label id="lblwidth"></label>
<script type="text/javascript">
var mywidth=192;
var tab = document.getElementById("tab");if (tab != null){
var totoalWidth=tab.offsetWidth;
if(totoalWidth%mywidth!=0)
{
totoalWidth+=mywidth-totoalWidth%mywidth;
}
lblwidth.innerText = totoalWidth;
tab.style.width=totoalWidth;
}</script>
</html>
这时候 lblwidth.innerText 的值是1344 但是 我在c#里 用WebBrowser获取这个控件 并得到值的时候 是384 请问 是怎么一回事
<html>
<head>
<title>ECP-DEMO</title>
</head>
<body style="margin:0 0 0 0;">
<table id="tab" border="1" style=" background-color:Black; border-width:1px; border-color:Red;color:Red;height:14px;font-family:宋体;font-size:16px;">
<tr>
<td>
今天是2010年8月11日星期三 阴历 七月初二。今日天气: 24 ℃ /32 ℃ 阴转多云 风向/风力: 微风 明日天气: 24 ℃ /29 ℃ 多云转雷阵雨 风向/风力: 微风 。
</td>
</tr>
</table>
</body>
<label id="lblwidth"></label>
<script type="text/javascript">
var mywidth=192;
var tab = document.getElementById("tab");if (tab != null){
var totoalWidth=tab.offsetWidth;
if(totoalWidth%mywidth!=0)
{
totoalWidth+=mywidth-totoalWidth%mywidth;
}
lblwidth.innerText = totoalWidth;
tab.style.width=totoalWidth;
}</script>
</html>
这时候 lblwidth.innerText 的值是1344 但是 我在c#里 用WebBrowser获取这个控件 并得到值的时候 是384 请问 是怎么一回事
解决方案 »
- 数据转换时,指定的转换无效。
- 求助,C#改变图像的亮度
- 如何修改List<T>里的数据?
- Q:通过类名和方法名动态返回结果
- C#人机对战小游戏制作中的问题
- VS2008的Net frameword2.0是Sp1的,那么在Vs2008下开的2.0程序能在非Sp1的net framewrok 2.0运行吗?
- GetFullPath 为什么会出错?谁能帮帮忙,先谢了。
- ---------------------------------------数据添加问题------------------------------------------
- 怎么样在Form2中用Form1中的控件?
- 请问C#怎样才能实现窗体最小化到托盘呢?
- c#使用Firebird.Data.Provider链接Interbase6.5存储过程总是出现问题啊?请高人指教
- if 语句 值输出问题
w.Navigate(child);
while (w.ReadyState != WebBrowserReadyState.Complete)
System.Windows.Forms.Application.DoEvents(); HtmlElement lblwidth = w.Document.Body.Children["lblwidth"];
int width = int.Parse(lblwidth.InnerText);