Hi @ all,
I have a more or less bigger problem :)
I would like to find out the username from that person which has opened the
Infopath form by Browser.
I try to do the following in my code:
Public Sub FormEvents_Loading(ByVal sender as Object, ByVal e as
LoadingEventArgs)
.......
Dim user_id as System.Security.Principal.WindowsIdentity
If Me.Application.Environment.IsBroser Then
user_id = System.Security.Principal.WindowsIdentity.GetCurrent
xpnUser.SetValue(user_id.Name)
Else
user = Application.User.LoginName
xpnUser.SetValue(user)
End IF
End Sub
The Else-Statement works absolutly fine for the Infopath 2007 Client
But the TRUE Statement where I try to collect the user_id does only pull the
Server name and not the customer name which actually edits the form.
I have no idea how to solve that issue at the moment.
Please can someone help me ?
Thanks for your time
Regards
Janko
JohannesPrinz@gmail.com - 12 Jun 2007 21:57 GMT
> Hi @ all,
>
[quoted text clipped - 34 lines]
> Regards
> Janko
Thought this might help you out
http://blogs.msdn.com/timpash/archive/2006/08/22/InfoPath-2007-CSharp-Code-For-R
etrieval-of-Username.aspx
Gaurav - 13 Jun 2007 14:14 GMT
Janko,
You can use the xpath function:
xdUser:get-UserName()
Thanks,
Gaurav