How to get user name or user ip address?
Hi to all!
I have written a little survey application for our intranet. In order to prevent users from taking the survey a second (3rd, 4th, 5th...) time, the app should detect the user name, or the ip address of the session.
Does someone know how to manage this with WebMatrix? Thanks!
MichaelTo finish first, you first have to finish.
Sure, you can use the Request object.
I searched the MSDN library. I found this article
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/h...How to get Hostname, IP address, port number, DB name, instance name using Query
As we know, normally we connect to a sybase server by just
identifying the node name and interfaces file and necessary
properties, but currently I want to get Host-name, IP
address, port number, DB name, instance name of connected
server out after connection created.
Does any one how to use query to do so? Does sybase provide
such functionality? Seems oracle can do so...
If there is no query, does sybase provides any API which can
instance name: select @@servername [assumes the DBA has defined a local entry in syservers]
db name: select db_name() [can...How to get windows log-in user name using vb.net code?
I built an asp.net web application on our companies HR system so that recruitors can post jobs. Is there a way to get the windows logged in user name using vb.net code?
This user name is using for tracking who posted the job.
Windows Authentication provides some options, as does forms authentication. See if you get what you need through User.Identity.Name. Take a look at:
JeffPlease: Don't forget to click "Mark as Answer" on the p...Is it possible to get user name from active directory using IP address?
Is it possible to get user name from active directory using IP address in .NET 2.0 code? So with the IP, you can find out the user name, then you know which user login using the specific PC.A piece of demo code please.
Don't think that it is a good approach. If your application relies on windows authentication then you can get the domain user Account by using this.User.Identity.Namewhere this is the instance of the page Jeev~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~If you get the answer to your question, please mark it as the answer.
Using this.User.Identi...How to get the user name of a process in vb.net?
Could anybody tell meHow to get the user/owner name of a process in vb.net?The reason I need it is because I developed an application,which I will put on the winnt enviroment, I want to allow multiple instance.but only allow one single instance per user.I am using Application.Run(MyMainForm) to start my applicationThanks,Joseph...Is there a way to get IP/Host name given the MAC address?
> Does anybody know's a way to get a Host name
> If I have a Mac address both in pc and sun?
> (it's the same as RARP but I don't know how to do it using command line )
1. SUN without DNS: arp -a
2. SUN with DNS: arp -a; nslookup hostname
% arp -a | grep '00:55:'
Net to Media Table
Device IP Address Mask Flags...How to get domain user's first name, last name and e-mail address
I am able to retrieve the domain/user ID by setting <authentication mode="Windows"/> in the Web.config file, and with the following code in my Default.aspx.,cs page:
string strName = Request.ServerVariables["AUTH_USER"];
I would also like to retrieve the users first name, last name and e-mail address from their domain profile, if possible. Can anyone help me with a code example? I'm somewhat new to C#/.NET/OOP so if you have it in "C# for Dummies" format, I would be very thankful!
Thanks in advance for any help that i...Can not get user name from HttpContext.Current.User.Identity.Name
I have tried to use HttpContext.Current.User.Identity.Name to get window user account. However, from debugger, for a long time ago I saw my window user name. But now, I did not see my window user name (from debugger) with the same code and same function call.
Please help. Was I doing something wrong? Or any special settings on web.config/machine.config or project to make it work??? I'm stuck
Thanks a lot
well, you have to have windows integrated authentiction enabled in IIS, IIRC.RTFM - straight talk for web developers. Unmoderated, uncensored, occasionally unre...Getting User My.User.Name to use in text box
Hi All,I have a page load event on my opening web page Default.aspx that includes the following code:
SearchString = My.User.Name.ToString()when I run the code on my localhost it tells me that SearchString is (lets say) mashfield, my logged on user name. However, when I i run it on our web server, searchstring returns blank.can anybody explain this?CheersMatt Matt A
This means your request is not authenticated. User.Identity.Name is expected to be an empty string if the request is anonymous.If might want to disable the Anonymous access in InetMgr, at the application level. If Window...How Do I get rid of \\ ( ie\\ipp//:ip address/ipp/printer) out of the start of my printer name
How Do I get rid of \\ out of the start of my printer name, I think this is
stopping me printing to some printers with certain drivers(HP driver don't
seem to mind). If I set printers up manual I do not have this problem and
the driver works with the printer, but if I use the automated iprint way it
adds \\ to the start of the printer name and it hangs my spooler file.
It appears that in the past few days you have not received a response to your posting. That concerns us, and has triggered this automated reply.
Has your problem been resolved? If not, you might ...Problem in getting logged in user Name for ASPX page with (even with this.User.Identity.Name)
Hi friends, I am creating an application that takes current logged in user and displays on the page itself. for this I am getting the user name in PageLoad function by using this.User.Identity.Name and then storing the value in a hidden variable for aspx page. I am using this hidden variable to display the name of the user. I am using Windows authentication for this. Now problem that I am getting is that when multiple user launch the application from different machine and if they click simultaneously, name of one user appears on the paged displayed on the machine of ot...Getting the MAC Address, ISP IP, Client IP of the user and verifying it to let the Login
Hi Everyone,Any help for getting the IP address of the client, its MAC address and its ISP IP so that after checking these he will be let into login.RegardsSadeed Remember to click “Mark as Answer” on the post If you get answer from this post(s) !Thanks GuysRegardsSid
Is this over the LAN or over the internet?Over the internet, you can only get the apparent IP address of the user (which may be the address of the external router).As to getting the IP of the ISP, then closest might be do a traceroute and take the last but IP address. Don't forget to click "Mark as Answer"...Get host name from IP address
does anyone have any simple C# code that can do this?pwpaust
Try this. It's a simple page that looks up both IP and name. I've put in some data to test with, but you can enter your own text!
<%@ Page Language="C#" %>
<%@ Import Namespace="System.Net" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
protected string DNSLookup(string domain)
string result = string.Empty;
IPHostEntry ipHe = Dns.GetHostEntry(domain);
IPAddress ipAd...Get domain name from IP address
Hi all, I want to convert an Ip address to corresponding domain name if any. Do i really need to use some third party components like IP2location .. Guys Please help.. thanks in advanceplease click 'Mark as Answer' if my post helped you.
HostName = System.Net.Dns.GetHostName();
IPAddres = System.Net.Dns.GetHostAddresses(HostName).GetValue(0).ToString();Thanks,AdamPlease "Mark as Answer" if this has helped you.
The above link is ...How to get IP address/name of the machine
I have a requirement to find out IP address/name of the machine to which a given windows user is currently logged on. Is that possible with C#? If anyone has came across sample code please guide me to appropriate resource. Blog: SEO Articles Website: Search Engine Ranking
Are you looking for this? Request.UserHostAddress() Jef Claes~~~~~~~~~~Visit my blog
Please try to use my code: public static string IPAddress
HttpRequest Request = HttpContext....