views:

1338

answers:

3

I have an Infopath 2007 form hosted on MOSS 2007. The code behind the form is written in C#. In this context, System.Environment.MachineName return the server name.

How can I get the name of the computer from which the client is filling this form?

+1  A: 

Would ASP.NET's Request.ServerVariables("REMOTE_ADDR") help?

Phil Reif
I did tried this method using a web service, but it returns the server IP address.
alexandrul
+1  A: 

If it's over the Internet: You can't get the PC Name AFAIK (which is a good thing).

If it's on an internal Network, maybe a DNS Lookup would work, as outlined here?

Michael Stum
This works if you have a DNS server on your network.
Kolten
The DNS lookups are working fine, but I can only get the IP address of the Sharepoint server which hosts the Infopath forms.
alexandrul
A: 

You can simply add a rule and assign any field you like the value from this xpath: xdUser:get-UserName(). This returns the users login name.

MrFox
I can get the user login name in more than one way, but I am trying to get the computer name (DNS name or NetBIOS name) from which the user is accesing the Infopath form.
alexandrul