这是我写的一个例子:
<div class="parent1">
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<div class="parent2">
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<div class="parent3">
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<p id="myElem">This is the element I want to get the top offset of.</p>
</div>
</div>
</div>
<button id="myBtn">Get top offset</button>
答案 0 :(得分:1)
您可以使用 try-catch
语句来了解将出现在您的代码中的异常或错误。
try
{
Process.Start(Proc);
}
catch(Exception ex)
{
MessageBox.Show(ex.Message);
}