Collecting Username from IE Client when Form is opend from Sharepo

J

Janko

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
 
J

JohannesPrinz

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

Thought this might help you out
http://blogs.msdn.com/timpash/archi...07-CSharp-Code-For-Retrieval-of-Username.aspx
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top