User Controls :: Get Client IP Address And Logged In Username Of Windows System
Mar 3, 2014I need client ip and login user name of a system, while using my web application in ASP.Net ....
View 1 RepliesI need client ip and login user name of a system, while using my web application in ASP.Net ....
View 1 RepliesHow can I assign logged in windows username as a parameter to sqldatasource in ASP.net web forms.
View 1 RepliesI have a ASP.NET application. From that, User register, User will get email after registration. My Req : When user click on link provided in email. Then it should go to my ASP.Net application page . That page should install a wincows application on Client system through web ( I was inspired by Microsoft Windows update from Microsoft site)
View 1 RepliesWhen a user log into my asp.net site I use the following code:
FormsAuthentication.RedirectFromLoginPage(userid, false);
As I often need to use the userid I can then later get the userid by:
string userid = System.Web.HttpContext.Current.User.Identity.Name;
Now I also want to show the logged in username on each page and my questions is therefore where do I place the username best if I need to use it on every page. User.Identity.Name is already taken by the userid so I can't use that one. Another solution would be to get the username from the database on each page, but that seems like a bad solution.
I want to capture when a user logs in and his username. I am using a login control inside a anonymous temp[late of a login view control. on the logedin event of the login I have this code:
Dim log As Login = CType(sender, Login)
If Not log.UserName = "bcweed@live.ca" Then
Dim mil As MailUtility = New MailUtility
mil.ClientLogin(log.UserName)
End If
but log.username is always empty and so is the page.user.identity.name and the page.user.identity.isauthenticated always returns false this even thouhgt this is the LogedIn event of the login and also I "just loged in" I really did.. is there a way to capture this is the global.asax?
How do I retrieve the UserName for a logged in user? Membership.GetUser().UserName doesn't work for me - Object reference not set to an instance of an object.I need it to get the associated UserID which my own db tables use as primary keyFurthermore, as I am a rookie is the best approach to achieve this through LoggedIn as below?
[Code]...
I have a data list on my page which shows a clients company, address and contact info. This information is stored in a sql database table. one of the columns is email address
Also on the page is a button and textbox set to multimode where the logged on client can send a message.
In the the button click event I want to send the message but capture the email address from the "Email" column and add this to the from part of the mail message as below
[Code]....
I just want to get the email address this way or get it from the membership system which ever is better.
We are using Profile.FirstName and Profile.LastName to get current user's firstname/last name. How do we get current user's email address?
View 2 RepliesI have set up security on my ASP.NET site and currently have 1 user (soon to be more!). I would like to send the logged-on user's username to a variable, to input this value to a custom-designed stored procedure on my SQL database (for recording search statistics).Does anyone know how I can harness the current logged-on users username? I am using VB. Will the following achieve the result?session(username)If so, how do I implement this? I tried using "Current_User" in the SQL stored procedure, but obviously this did not record the ASP.NET user. Also, if the current user has not logged onto the site, I would like the "username" value to be "annonymous".
View 10 RepliesHow to retrieve the current authenticated logged in user's email address who is accessing the page.
I have managed to do it with users. How to get the current authenticated user's email address if that makes sense.
Here is my aspx code:
[Code]....
and my VB script:
[Code]....
Somebody suggested that I should run a query. If you know the user name accessing the page, surely you can take that information, insert it into a query to find out the email address of the user accessing the page. Sounds great but don't have a clue how to do it.
I want to display client system information like username,ipaddress. I get only the remote address.Let me know how to get the client system information.
View 6 RepliesI Want to get client system information that is
1. Client system name
2. Logon Username
3. OS Drive Name
4. how to copy a file from server to client ?
I have profile variable called IP Address ,
i need this Profile to add Unique IP address that has been used by the UserName ,,,
meaning :
If i logged in for the first time , it will save my IP address , next time if my IP has changed and i logged in , i need to keep the old IP address and add to it with comma seperated the new IP ..
How to update username of current logged username?
View 10 RepliesIm using forms authentication on a site. I have a requirement where I have to log the username of the user that is currently logged into the computer. It is not a public site. It is an intranet site at work. I have tried several different methods but they all return the username of the user that is logged into the site. The methods I have tried are below. Note: I would perfer to log the username without the domain.
[Code]....
Im using forms authentication and im trying to get the current username. I tried using Environment.UserName but I am getting "ASPNET". But if i change my application to windows authentication im getting the true username that is currently logged on. How can I get the true username that is currently logged on in the domain using the forms authentication.
View 3 RepliesI used following methods
HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"]
Request.ServerVariables["REMOTE_HOST"]
Request.UserHostAddress
Request.UserHostName
All the above are returning "127.0.0.1", not the actual IP.
The below one returns null.
HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"]
Below one always returns where the application is hosted/running, not the client's IP address.
string strHostName = System.Net.Dns.GetHostName();
string clientIPAddress = System.Net.Dns.GetHostAddresses(strHostName).GetValue(0).ToString();
I'm using forms authentication in my application but i want to get the active directory domain anme and user name of the logon user. is that possible. The IIS Directory security settings are Anonymous Access allowed and Integrated windows authentication ticked. I tried the following but to no avail
Request.LogonUserIdentity.Name (this is returning the machine name and user name used for anonymous access)
System.Security.Principal.WindowsIdentity.GetCurrent().Name -> returning NT AUTHORITYNETWORK SERVICE
we are migrating existing windows form application to asp.net(3.5) intranet portal, there is a requirement whereby database connection should be made by the logged in windows user. Is it possible to achieve this functionality?
View 1 RepliesI have a really weird problem that I've been investigating for at least one week now. I deliver a website hosting both ASP classic and .NET 3.5 content in IIS6 on a Windows 2003 server environment with MySQL db backend. The solution has been installed on several servers (some hosted in WMWare) with no problems. On one specific server, also hosted in WMWare, the user experience great performance issues on the website. The problems are most seen when using database resources and is not limited to either .net or asp classic, but I am still not sure that the problem is only related to database calls.
Following components are involved:
IIS6 .NET FW 3.5 MyODBC 3.51 / 5.1 MySQL 4.x
Code executed on the server using all resources above runs smoothly when the IIS is not involved. The website shows times up to 2 minutes to execute code that takes 2 seconds outside the IIS. The exact same code is executed. Using profiling tools, I've seen that the great loss comes within calls to unmanaged code, for example when System.Data.ODBC namespace to calls into myodbc.dll.
The tricky part is: If at least one console user is logged in to the server, the performace problems are not seen anymore. When the user logs out, the problem appears again.I have tried to reinstall all components above, tried different versions of MyODBC, tried different website authentication methods, tried to run website under administrator privilegies, installed various MS KB's with no success.
I'm not sure why this is happening. I have 3 client machines all using VS 2008 with team explorer. All three clients are my own and have the same login name, "Ryan". On two of the machines, the workspace owners say "Ryan" but the 3rd says "Administrator". On that one, I'm logged in as Ryan. I'd like it to be Ryan instead of Administrator but am not sure why this is happening. When I force it to use Ryan, it allows me to, but no longer appears on the list (but does show up as a workspace under the other 2 clients).
View 2 RepliesI having problem in display the username after a user logged in.This is my master page which has label which named Label1 on top right, i want to display the username on there after logged in.
View 4 RepliesWhen am using below code it's working fine on my local host but when am host on server getting error.
Response.Write("sam "+System.Net.Dns.GetHostEntry(Request.ServerVariables["REMOTE_HOST"]).HostName);
Error:
The requested name is valid, but no data of the requested type was found.
I would like users to upload a profile picture when they register, and to then show that picture in a picture box control when they are logged in based on that specific user.
View 1 RepliesI was not able to find the post. I am building an MVC app and on the master page I want to display the user that is logged into the workstation. This is just an internal app so we were just going to use
AD authentication. I am not sure how ISS will be configured on the anonymous or impersionate part so I did this line of code in the master page
<%=Environment.GetEnvironmentVariable("USERNAME") %>
Is this proper and the best way or should I look for a better way. I know this is generic but just curious.