Possible To Retrieve Users Profile Using Their Membership User Id?
Feb 19, 2012
Using the Asp.net Membership & Profile Providers: Am I able to retrieve a user profile using their Membership UserID instead of their Username?The reason I ask is because if I have the UserID and not the Username I would have to write the following two lines of code [code]Dim Profile As Profile = Profile.GetProfile("UserID")Will this affect performance? Is my design bad? Am I missing something? I am aware that I can retrieve the current logged in user using the following code: HttpContext.Current.User.Identity.Name
I want to pass an asp.net membership user name to a subroutine and retrieve the profile property named FullName for that user, how can i achive this in vb.net?
The logged-in 'UserId' and 'UserName' is getting displayed correctly, but now how do I use the string 'lmember' in my 'SELECT' statement when I need to display the related information from the table 'aspnet_Users' for the logged-in user? getting the following select statement:
SelectCommand="SELECT * FROM aspnet_Users WHERE (UserName= ????)"
when building my application I am getting some temporary files shown in Solution Explorer under Miscellaneous Files lie App_Web_YDKG.VB with following code block in that generating error
Protected ReadOnly Property Profile() As System.Web.Profile.DefaultProfile Get Return CType(Me.Context.Profile,System.Web.Profile.DefaultProfile) End Get End Property
Error : Error 58'Protected ReadOnly Property Profile() As System.Web.Profile.DefaultProfile' has multiple definitions with identical signatures.C:WINDOWSMicrosoft.NETFrameworkv2.0.50727Temporary ASP.NET Filesinfinityvb2ae71c27d560144bApp_Web_pwduczex.38.vb456
I've been searching for a while, but it seems that I can't find an easy way to get the current user profile folder. I've tried "%userprofile%" environment variable, but it didn't worked (or I'm doing something wrong).How can I do it? I want to add the value to an string variable.
I actually tried something like: Dim Userfolder As String = %UserProfile%
I tried with quote marks too, but none seems to do the trick.What I'm missing?
I need to find out the path to the logged in users profile folder in VB.NET.
I know there is one to get the AppData folder but I need only the profile path becuase there is a file I need to read in the root of the profile folder.
I have a website with login and register forms using custom HDI Membership provider where Users can login or register new account.
Now I have a desktop software and trying to have two forms for login and register where my users can able to login or register for user convenience and not by going to the website and make them register online.So, I have these to know in order to go further.
1) Can I use HDI membership provider as I have used it in my web application?As previously I have done and I faced many problems and still didn't get clarified here
2) If No, how do I make use in order to make use the same HDI Membership.Finally I need to use the same database for my desktop software as well as my web application with all the possibilities (i.e. I need to validate each parameter of my membership class).I am able to register the user but it is not using the Membership and I'm unable to know why it is not picking up the membership provider from the app.config file.
I am using asp.net membership and trying to update a users details but get the following error: Error 2 Overload resolution failed because no accessible 'New' accepts this number of arguments.
Below is the full .vb code: Partial Class FamilyAdmin_edit_user Inherits System.Web.UI.Page Private username As String Dim user As MembershipUser Private Sub Page_Load() [Code] .....
Before I had: Dim user As MembershipUser
And got the error: Object reference not set to an instance of an object. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Source Error: Line 20: 'parameterless constructor Line 21: Line 22: .....
Is it possible for a VB.NET web application to check the user's Windows security group and behave differently accordingly?I'd like to disable a certain bit of functionality if the user does not belong to a specific windows group.I've tried using the Microsoft code at url... but get the error "Reference to a non-shared member requires an object reference" on the "irc = WindowsIdentity.Groups" line (I have imported all the required namespaces).Does anyone know if it's possible to get the user's security group?
Need to copy files to a directory within the user profile. simple task if i hard code the path, however i need the code to account for different users who run the code. this is where i run into the issue. code so far
Dim src As String src = Environment.GetEnvironmentVariable("userprofile") Label1.Text = src
I am looking for code to create user profiles on new pc without logging them in.I will have admin rights but want to create a default profile for each user and copy some files to each profile before the user logs on the first time/
In my VS solution, I have two projects.One for the Web Interface, other for DataAcess and BusinessLogic. I know I can check if the currently logged-on user is Employee in Web Interface project like this from the code behind:
Dim isEmployee = User.IsInRole("Employee")
The problem is that I have a Class call UserManagement in my the DA and BL project which I want to check the currently logged-on user role also. I can't use Dim isEmployee = User.IsInRole("Employee") because it doesn't have aspx page.
What do I need to do to check the user role in my custom class?
I am creating a VB.NET application for a Calculus class as a little side-project. It requires user profiles that are saved locally in the program's main files. I am using 2 separate classes to access the user profiles right now.
The first class is called Config and it is used to manipulate the basic config file which contains lesson document paths, settings, and user profile names.
The second class is called User and it is used to load up user profiles from a profile directory where user data is saved in separate text files.
The Config class retrieves the user names, and user profile text file paths. This text file path is then handed off to a User object that can then load up and interpret the file.
how should I format the config file and user files so they are secure enough that someone can not easily retrieve or manipulate data?
Here is a sample of how I am reading the text files:
Dim userList() As String = {Nothing} If My.Computer.FileSystem.FileExists(configPath + "config.cfg") Then Using MyReader As New Microsoft.VisualBasic.FileIO.TextFieldParser(configPath + "config.cfg")
[Code]....
The problem isn't reading the text file, I am just not sure how to make it secure. I was thinking about first parsing the entire file to translate it from 'encrypted' to text, and then save it as a temporary file which I would pass off to the above code, then delete the file immediately afterward. As for 'encrypting' (is that the right word for this?) the file, I could maybe bit-shift each character using a key that I would save at the beginning of the file.
I know, it's a bit weird asking for a query to tell me my own email address right, I'll explain further...
I'm writing a COM add-in for Outlook 2007. One of the subs generates and sends an email to a particular address and this all works fine.However I have a need to have an option for the sender to be able to include themselves on the recipients list.As more than one person will be running this I cannot just set the sender's email address manually and would prefer to just add a check box on the form to enable this feature.
The only bit I'm stuck on is working out how to find the email address of the person sending the email. I could do it with an AD query against the logged on user but this needs to work for non-domain users also so need another method.
I have researched quite a lot on how to retrieve user information from Yahoo Music API, i have read Open Social as well and looked at Yahoo documentation but can't find what I am looking for.
For my user system, I require each user to have a unique id. The reading in and saving of the user data is all done, but now I'm focusing on adding new users. In my add user dialog, I have the information fields required to create a new user, one of which is the ID (which must be unique). For this I have created a function that I thought would always give a unique id but it does not. paste the code below:
Function getnextuserid() Dim id As String Dim unique As Boolean
I've got a website and we just had a huge jump in traffic. Now all of the sudden we're getting sql parameter errors left and right. We switched to a new sql server a few weeks ago and everything has been fine but the added traffic seems to be breaking us.I have a data access class that is called when each user trys to logon. It runs through several tasks before finally updating the users last login date and forwarding them to the administration section.
What I'm seeing from the trace logs suggests that when I'm logging in the first several tasks are using my data (lets say user=birk pass=word). But at some point the accessor class starts sending over the data from someone else who's trying to login (lets say user=abcxyz).Every connection we make to the server is closed when we're finished with it. I'm nulling out all of the accessor objects when I'm finished with them. But somehow different user data from different sessions are making their way into other peoples instances of the object.
I'm not using session/application/cache/viewstate to store the objects so I'm not really seeing how they could edit eachother... Its just really weird and I'm not sure how to even go about researching the problem.This is roughly the accessor class... I trimmed out some of the parts that weren't reliant to the issue
I am using the Mysql .NET connect and can connect to my database using my program. i want to be able to get a Users Password from the database using there user name
This is the query i want to use: "SELECT Password FROM staff WHERE Username = " & textbox1.text & " '". But i don't know how to run that query and to get it to store the Password as a variable
I have a users domain and user id. I would like to retrieve the full user name. The data is coming from a SQL table for display onto an asp.net page. Anyone know how to get the users name for someone other then the user who is using the asp.net application?
Dim Process As New Process() Dim Count As Integer = 0 For Each Process In Process.GetProcesses(My.Computer.Name)
[code].....
I have that currently. What I want is instead of it loading ALL processes, I only want it to load processes from the current user. (ie. Ryan or Andrew, not SYSTEM or LOCAL.)'ve done research on Google looking how to implement and I've gotten some code on how to retrieve a User Name of the current user but nothing prevailed for what I needed :[ Any ideas? I'm noobish, taking Computer Science in Fall so I'm preparing and still learning.