📄 owassowebpart.cs
字号:
using System;
using System.Collections.Generic;
using System.Text;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Microsoft.SharePoint.Portal.SingleSignon;
using Microsoft.SharePoint.Portal;
namespace OWASSOWebPart
{
public class OWASSOWebPart : WebPart
{
protected override void Render(System.Web.UI.HtmlTextWriter writer)
{
string strSSOLogonFormUrl = SingleSignonLocator.GetCredentialEntryUrl("OWA");
try
{
writer.Write("If your login fails, please <a href=\"" + strSSOLogonFormUrl + "\">Update your credentials</a> with your new password.<br/>");
string[] rgGetCredentialData = null;
Credentials.GetCredentials(1, "OWA", ref rgGetCredentialData);
string src = "/_layouts/OWARedirect.htm?l=" + rgGetCredentialData[0] + "&p=" + rgGetCredentialData[1];
writer.Write("<iframe frameborder=\"0\" width=\"800\" height=\"600\" src=\"" + src + "\"/>");
}
catch (SingleSignonException ssoe)
{
if (SSOReturnCodes.SSO_E_CREDS_NOT_FOUND == ssoe.LastErrorCode)
{
Context.Response.Redirect(strSSOLogonFormUrl);
}
else
{
writer.Write(ssoe.Message);
}
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -