Get/set a Profile

P

PhilTheGap

Hi there,

I'm looking for a way to get and update the "Profile" of a user. As I'm not
logged as this user, I cannot use the System.Web.Profile class, and after
having a look at MSDN, I don't see any classes among this namespace
(ProfileManager, ProfileInfo...) which could help me.

Best regards
 
S

Steven Cheng [MSFT]

Hi Phil,

As for the ASP.NET Profile property, you can manage other users' profile
proiperties as long as you have the username. I assume you're using C#,
here is some sample code which access the profile properties of a specific
user:
protected void Button1_Click(object sender, EventArgs e)
{
ProfileBase userpf = ProfileBase.Create("username");

//get property value
userpf.GetPropertyValue("propertyname");
//set property value
userpf.SetPropertyValue("propertname", Value);

}
<<<<<<<<<<<<<<<<<<<<<<<<<

Also, you can use ProfileManager class to query all the existing profile in
the current asp.nett application:
ProfileInfoCollection pic
=ProfileManager.GetAllProfiles(ProfileAuthenticationOption.All);

foreach (ProfileInfo pi in pic)

Hope this helps.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.


--------------------
 
P

PhilTheGap

Hi Steven,
Steven Cheng said:
Hi Phil,

As for the ASP.NET Profile property, you can manage other users' profile
proiperties as long as you have the username. I assume you're using C#,
here is some sample code which access the profile properties of a specific
user:
protected void Button1_Click(object sender, EventArgs e)
{
ProfileBase userpf = ProfileBase.Create("username");

//get property value
userpf.GetPropertyValue("propertyname");
//set property value
userpf.SetPropertyValue("propertname", Value);

}
<<<<<<<<<<<<<<<<<<<<<<<<<
Fine.

Thank you
 
S

Steven Cheng [MSFT]

Thanks for your reply Phil,

If you have any other questions, welcome to post here.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
From: "PhilTheGap" <[email protected]>
References: <[email protected]>
In-Reply-To: <[email protected]>
Subject: Re: Get/set a Profile
Date: Fri, 6 Jun 2008 16:16:46 +0200
Hi Steven,
"Steven Cheng [MSFT]" <[email protected]> a écrit dans le message
de news:[email protected]...
Hi Phil,

As for the ASP.NET Profile property, you can manage other users' profile
proiperties as long as you have the username. I assume you're using C#,
here is some sample code which access the profile properties of a specific
user:

protected void Button1_Click(object sender, EventArgs e)
{
ProfileBase userpf = ProfileBase.Create("username");

//get property value
userpf.GetPropertyValue("propertyname");
//set property value
userpf.SetPropertyValue("propertname", Value);

}
<<<<<<<<<<<<<<<<<<<<<<<<<
Fine.

Thank you
 

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

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,074
Latest member
StanleyFra

Latest Threads

Top