By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,837 Members | 1,206 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,837 IT Pros & Developers. It's quick & easy.

problem with client-side details using ExpandEnvironmentVariables

P: n/a
Hi,

I'm creating an ASP.NET Web Application in vs 2005 (VB) and need to get the
location of the users User profile. The code below works...
Environment.ExpandEnvironmentVariables("%UserProfi le%"))

...But when you upload the website onto the server it retrieves the servers
user profile location and not the users.

Is there anyway to retrieve the user profile of a given user?

Thanks for you help and time

Jul 16 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
On Jul 16, 4:38 pm, Damien <D...@community.nospamwrote:
Hi,

I'm creating an ASP.NET Web Application in vs 2005 (VB) and need to get the
location of the users User profile. The code below works...
Environment.ExpandEnvironmentVariables("%UserProfi le%"))

..But when you upload the website onto the server it retrieves the servers
user profile location and not the users.

Is there anyway to retrieve the user profile of a given user?

Thanks for you help and time
hi,
Its seems your not clear about how web application work...your server
side code never executed in client side.
do not think like desktop programming ,,,
change your mind to web domain...

thanks
nahid

Jul 16 '07 #2

P: n/a
Thanks for you response.

When working with asp coding you are able to retrieve the user profile of
the person who is using the web app:

Set objShell = CreateObject("wscript.Shell")
UserProfile = objShell.ExpandEnvironmentStrings("%UserProfile%")

Doing this in vs brings the server details back. Is there an alternative
way of making it get the users details?

An example where this happens elsewhere is:
In asp - request.servervariables("LOGON_USER") retrieves the users username.
In vs 2005 this same code retrieves the server's username. What I had to
use instead was My.User.Name

Thanks

Damien
"nahid" wrote:
On Jul 16, 4:38 pm, Damien <D...@community.nospamwrote:
Hi,

I'm creating an ASP.NET Web Application in vs 2005 (VB) and need to get the
location of the users User profile. The code below works...
Environment.ExpandEnvironmentVariables("%UserProfi le%"))

..But when you upload the website onto the server it retrieves the servers
user profile location and not the users.

Is there anyway to retrieve the user profile of a given user?

Thanks for you help and time

hi,
Its seems your not clear about how web application work...your server
side code never executed in client side.
do not think like desktop programming ,,,
change your mind to web domain...

thanks
nahid

Jul 16 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.