User.IsCurrentUser(String) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets whether the specified user is the current user.
public:
abstract bool IsCurrentUser(System::String ^ userName);
public abstract bool IsCurrentUser (string userName);
abstract member IsCurrentUser : string -> bool
Public MustOverride Function IsCurrentUser (userName As String) As Boolean
Parameters
- userName
- String
The user's name in the format of domain\username.
Returns
true if the specified user is the current user; otherwise false.
Examples
In the following example, clicking the Button control displays whether the specified user is the current user.
public void CTRL1_Clicked(object sender, ClickedEventArgs e)
{
MessageBox.Show(
this.Application.User.IsCurrentUser(
"CONTOSO\\markus").ToString());
}
Public Sub CTRL1_Clicked(ByVal sender As Object, _
ByVal e As ClickedEventArgs)
MessageBox.Show( _
Me.Application.User.IsCurrentUser("CONTOSO\markus").ToString())
End Sub
Remarks
This member can be accessed only by forms running in the same domain as the currently open form, or by forms that have been granted cross-domain permissions.
This type or member can be accessed only from code running in forms opened in Microsoft InfoPath Filler.