本文整理汇总了C#中System.Web.ClientServices.ClientFormsIdentity.IsAuthenticated属性的典型用法代码示例。如果您正苦于以下问题:C# ClientFormsIdentity.IsAuthenticated属性的具体用法?C# ClientFormsIdentity.IsAuthenticated怎么用?C# ClientFormsIdentity.IsAuthenticated使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类System.Web.ClientServices.ClientFormsIdentity
的用法示例。
在下文中一共展示了ClientFormsIdentity.IsAuthenticated属性的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SaveSettings
private void SaveSettings()
{
System.Security.Principal.IIdentity identity =
System.Threading.Thread.CurrentPrincipal.Identity;
// Return if the user is not authenticated.
if (identity == null || !identity.IsAuthenticated) return;
// Return if the authentication type is not "ClientForms".
// This indicates that the user is not authenticated for
// client application services.
if (!identity.AuthenticationType.Equals("ClientForms")) return;
try
{
Properties.Settings.Default.Save();
}
catch (System.Net.WebException)
{
MessageBox.Show("Unable to access the Web settings service. " +
"Settings were not saved on the remote service.",
"Not logged in", MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
}