html代码:<html>
<head>
<title>XI 3.0 Single Sign-On Java InfoView</title>
<link href="style.css" rel="stylesheet" type="text/css" />
</head><body>
<div id="mainContainer">
<div id="sampleDescriptionDiv">
<h1 id="sampleTitle">XI 3.0 Single Sign-On Java InfoView</h1>
<p id="sampleDescription">Demonstrates how to Single Sign-On to XI 3.0 Java InfoView by logging onto BusinessObjects Enterprise and passing a serialized Enterprise Session.</p>
</div>
<!-- Form to capture information necessary to run the sample
****************************************************** -->
<form id="sampleForm" method="post" action="java_enterprise_be12_sso_infoview.jsp">
<table class="infoTbl">
<th colspan="2" class="tableHeader">Required info</th>
<tr>
<td>CMS Name: </td>
<td><input type="text" name="bo_cms_name" class="formField"/></td>
</tr>
<tr>
<td>User Name: </td>
<td><input type="text" name="bo_username" value="Administrator" class="formField"/></td>
</tr>
<tr>
<td>Password: </td>
<td><input type="text" name="bo_password" class="formField"/></td>
</tr>
<tr></tr>
<tr>
<td>Authentication Type: </td>
<td>
<select name="bo_auth_type" size="1" class="formField">
<option value="secEnterprise">Enterprise</option>
<option value="secLDAP">LDAP</option>
<option value="secWinAD">Windows AD</option>
</select>
</td>
</tr>
<tr>
<td>InfoView Start Page: </td>
<td><input type="text" name="infoview_url" class="formField" value="http://<hostname>:<port>/InfoViewApp/logon/start.do"/></td>
</tr>
<tr>
<td></td>
<td><input id="submitBtn" type="submit" class="btn" value="Submit"/></td>
</tr>
</table>
</form>
<div class="infoDiv">
<table class="infoTbl">
<th colspan="1" class="tableHeader">Notes:</th>
<tr>
<td>
<p>You can view the <a href="readme.txt" target="_blank">Read Me</a> file for instructions on how to install this sample.</p>
<p>Please visit our <a href="http://devlibrary.businessobjects.com/" target="_blank">online library</a> for our up-to-date SDK help files.</p>
<p>Disclaimers and more info <a href="more_info.html">here</a>.</p>
</td>
</tr>
</table>
</div>
<div id="copyright">© Business Objects Technical Support</div>
</div>
</BODY>
</HTML>
C#代码
[code=C#]
HtmlDocument doc = myWB.Document;//获取Document对象
foreach (HtmlElement em in doc.All)
{
//查找所有文档元素
string str = em.Name;
//减少处理
if (str == "bo_cms_name")
em.SetAttribute("value", cms);
if (str == "bo_username")
em.SetAttribute("value", uid);
if (str == "bo_password")
em.SetAttribute("value", pwd);//赋密码内容
if (str == "infoview_url")
em.SetAttribute("value", port);
}
foreach (HtmlElement em in doc.All)
{
string str2 = em.GetAttribute("type");
if (str2 == "submit")
{
em.InvokeMember("click");
}
}
其中给input赋值的都可以,就是触发点击没反应,
myWB.Document.Forms[0].InvokeMember("submit");
和
HtmlElement button = myWB.Document.GetElementById("submitBtn");
button.InvokeMember("click");
都试了,都没反应,怎么能触发点击呢?
<head>
<title>XI 3.0 Single Sign-On Java InfoView</title>
<link href="style.css" rel="stylesheet" type="text/css" />
</head><body>
<div id="mainContainer">
<div id="sampleDescriptionDiv">
<h1 id="sampleTitle">XI 3.0 Single Sign-On Java InfoView</h1>
<p id="sampleDescription">Demonstrates how to Single Sign-On to XI 3.0 Java InfoView by logging onto BusinessObjects Enterprise and passing a serialized Enterprise Session.</p>
</div>
<!-- Form to capture information necessary to run the sample
****************************************************** -->
<form id="sampleForm" method="post" action="java_enterprise_be12_sso_infoview.jsp">
<table class="infoTbl">
<th colspan="2" class="tableHeader">Required info</th>
<tr>
<td>CMS Name: </td>
<td><input type="text" name="bo_cms_name" class="formField"/></td>
</tr>
<tr>
<td>User Name: </td>
<td><input type="text" name="bo_username" value="Administrator" class="formField"/></td>
</tr>
<tr>
<td>Password: </td>
<td><input type="text" name="bo_password" class="formField"/></td>
</tr>
<tr></tr>
<tr>
<td>Authentication Type: </td>
<td>
<select name="bo_auth_type" size="1" class="formField">
<option value="secEnterprise">Enterprise</option>
<option value="secLDAP">LDAP</option>
<option value="secWinAD">Windows AD</option>
</select>
</td>
</tr>
<tr>
<td>InfoView Start Page: </td>
<td><input type="text" name="infoview_url" class="formField" value="http://<hostname>:<port>/InfoViewApp/logon/start.do"/></td>
</tr>
<tr>
<td></td>
<td><input id="submitBtn" type="submit" class="btn" value="Submit"/></td>
</tr>
</table>
</form>
<div class="infoDiv">
<table class="infoTbl">
<th colspan="1" class="tableHeader">Notes:</th>
<tr>
<td>
<p>You can view the <a href="readme.txt" target="_blank">Read Me</a> file for instructions on how to install this sample.</p>
<p>Please visit our <a href="http://devlibrary.businessobjects.com/" target="_blank">online library</a> for our up-to-date SDK help files.</p>
<p>Disclaimers and more info <a href="more_info.html">here</a>.</p>
</td>
</tr>
</table>
</div>
<div id="copyright">© Business Objects Technical Support</div>
</div>
</BODY>
</HTML>
C#代码
[code=C#]
HtmlDocument doc = myWB.Document;//获取Document对象
foreach (HtmlElement em in doc.All)
{
//查找所有文档元素
string str = em.Name;
//减少处理
if (str == "bo_cms_name")
em.SetAttribute("value", cms);
if (str == "bo_username")
em.SetAttribute("value", uid);
if (str == "bo_password")
em.SetAttribute("value", pwd);//赋密码内容
if (str == "infoview_url")
em.SetAttribute("value", port);
}
foreach (HtmlElement em in doc.All)
{
string str2 = em.GetAttribute("type");
if (str2 == "submit")
{
em.InvokeMember("click");
}
}
其中给input赋值的都可以,就是触发点击没反应,
myWB.Document.Forms[0].InvokeMember("submit");
和
HtmlElement button = myWB.Document.GetElementById("submitBtn");
button.InvokeMember("click");
都试了,都没反应,怎么能触发点击呢?
解决方案 »
- ScriptManager和ClientScript
- %# Eval(getPower()) == "1" ? "显示div'admins'": "隐藏div"%> 怎么写 +100
- 模板列里面添加update语句
- 菜鸟问题:怎样在后台调用table的Cssclass
- 代码中有几行看不懂,知道的请帮忙解释。THANKS !
- 软件就是服务----webservice调用金山词霸的问题
- 网站发布问题
- 读取XML文件的问题
- 如何在.net中使用数据组件的步骤?
- 见鬼,这是不是ASP.NET的一个漏洞????????????????????????
- 点登陆没反应
- 在应用程序级别之外使用注册为 allowDefinition='MachineToApplication' 的节是错误的。如果在 IIS 中没有将虚拟目录配置
InvokeMember("Ck")