Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / General MS InfoPath Questions / March 2006

Tip: Looking for answers? Try searching our database.

InfoPath & System.Environment.UserName

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Sushi - 16 Feb 2006 23:29 GMT
In my InfoPath form I am autofilling a textbox with
System.Environment.UserName as in the MSDN Infopath Training.  I then use
this field as the login information for a query to a web service.  I am
having trouble with the form retrieving the UserName after I publish it for
users to access via a web page link to the form.  Anyone have any suggestions?
Alessandro Catorcini [MSFT] - 16 Feb 2006 23:49 GMT
Where is the server where you published the form?
If it is on an intranet, it should work, but if it is on the Internet, the
behavior is by design: the form template gets the same permissions that a
web page on the same location would have, and you don't want a web page to
read the username of the logged-in user.

Hope this helps

--Alessandro

This posting is provided "AS IS" with no warranties, and confers no rights.

> In my InfoPath form I am autofilling a textbox with
> System.Environment.UserName as in the MSDN Infopath Training.  I then use
[quoted text clipped - 3 lines]
> users to access via a web page link to the form.  Anyone have any
> suggestions?
Sushi - 17 Feb 2006 15:31 GMT
The form is published on an intranet, so I don't believe that is the issue.  
Would you know if this has anything to do with how I enable full trust?

> Where is the server where you published the form?
> If it is on an intranet, it should work, but if it is on the Internet, the
[quoted text clipped - 15 lines]
> > users to access via a web page link to the form.  Anyone have any
> > suggestions?
hobbyman - 22 Feb 2006 20:10 GMT
I was wondering if you ever figured out the answer. I am having the
very same problem and have been working on it for a few days.

--lance

> The form is published on an intranet, so I don't believe that is the issue.  
> Would you know if this has anything to do with how I enable full trust?
[quoted text clipped - 18 lines]
>>> users to access via a web page link to the form.  Anyone have any
>>> suggestions?
Sushi - 22 Feb 2006 20:23 GMT
I believe it had to do with the order of my code.  Here is what I now have, I
hope it helps:

Dim emp As New WebService.Class
Dim ds As DataSet = emp.WebMethod(System.Environment.UserName)

Dim nodeEmpName As IXMLDOMNode =
thisXDocument.DOM.selectSingleNode("my:myFields/my:txtEmpName")

If nodeEmpName.text = "" Then
nodeEmpName.text = ds.Tables("Employee").Rows(0).Item("DisplayName")
End If

> I was wondering if you ever figured out the answer. I am having the
> very same problem and have been working on it for a few days.
[quoted text clipped - 23 lines]
> >>> users to access via a web page link to the form.  Anyone have any
> >>> suggestions?
Marion - 15 Mar 2006 16:02 GMT
Could you share you code you use to autofill the textbox with
System.Environment.UserName. I need to do that and I haven't been able to
find an example of doing this.

Thanks

> In my InfoPath form I am autofilling a textbox with
> System.Environment.UserName as in the MSDN Infopath Training.  I then use
> this field as the login information for a query to a web service.  I am
> having trouble with the form retrieving the UserName after I publish it for
> users to access via a web page link to the form.  Anyone have any suggestions?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.