OWA 获取当前登录帐号
OWA 2003上可以通过javascript脚本获取当前帐号
function getusernow()
{
try{
return window.location.pathname.split('/')[2]
}
catch(err){
return escape(g_sUserDisp);
}
}
{
try{
return window.location.pathname.split('/')[2]
}
catch(err){
return escape(g_sUserDisp);
}
}
OWA 2007上可以通过在对应的aspx页面中添加如下脚本
<%
string strId = User.Identity.Name;
if (strId.IndexOf("\\") != -1)
{
string[] arry = strId.Split("\\".ToCharArray());
if (arry.Length > 1)
strId = arry[1];
}
Response.Write("var UserId = '" + strId + "';");
%>
string strId = User.Identity.Name;
if (strId.IndexOf("\\") != -1)
{
string[] arry = strId.Split("\\".ToCharArray());
if (arry.Length > 1)
strId = arry[1];
}
Response.Write("var UserId = '" + strId + "';");
%>
posted on 2010-10-30 14:28 alronzhang 阅读(263) 评论(0) 编辑 收藏 举报