How to get IP address or name of the server?

I need to get the IP address or name of the server that runs my asp.net application. Which class, method should I use? 

Thanks!
0
snie
6/21/2004 9:18:25 PM
asp.net.getting-started 91979 articles. 3 followers. Follow

2 Replies
650 Views

Similar Articles

[PageSpeed] 36

Try this:

Request.ServerVariables["SERVER_NAME"]
Darrell Norton, MVP
Darrell Norton's Blog


Please mark this post as answered if it helped you!
0
DarrellNorton
6/21/2004 11:24:46 PM
Thank you very much.

I tried "SERVER_NAME", but it gives me more info than I need. I used
Request.ServerVariables["HTTP_HOST"] instead.
0
snie
6/22/2004 1:18:16 PM
Reply:

Similar Artilces:

get IP Address _ Server Name
Hi , All Does anyone know how to get IP Address of Server Name ? Im using PB9.0 and SQL Server 2000 We have four servers and all the same servername(the same SQLCA.servername), just different IP Address . I would like to get IP address to know what server the user has connected . Thanks for helping! ---== Posted via the PFCGuide Web Newsreader ==--- http://www.pfcguide.com/_newsgroups/group_list.asp You do a winsock getaddrinfo call: http://msdn2.microsoft.com/en-us/library/ms738520.aspx There's also a GetAddrInfoEx call that might work better (it shoul...

How Do I get rid of \\ ( ie\\ipp//:ip address/ipp/printer) out of the start of my printer name
Hi, 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. Michael, 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 ...

Getting server IP Address.
Hi. How can I get ASA server IP Address or computer name ? Best Regards. Yossi. run either ipconfig (NT), winipconfig (59/98), config.nlm (Novell, gives node/network and I think also ipaddress), or easier yet, ping the machine name (assuming you know it). Once you obtain this, use this as the Host or MyIP values for tcpip switch i.e. dbsrv6.exe -n <servername> -x tcpip{MyIP=<ipaddress>} -- Ian Bater Sybase - iAnywhere Solutions Please reply to newsgroup Yossi Zaig wrote: > Hi. > > How can I get ASA server IP Address or computer name ? ...

How to Get Server IP Address ?
Hi All,  I have the three things for my database DSN Name, userid and password. Even don't know the server IP.How can i get the Database Server Id and Database dump ? I can copy a form on the server. By doing this is there any way to get databse server IP ? Please tell me anybody about this , it's very urgent . Thanks in Adv.   Best Of Luck ......... start > run > cmd > type "ipconfig /all" that will display the ID Config in code: Request.UserHostAddress for a configured app: web.config file? If you have the hostname you can do: start &...

POST GET GET GET GET... WTH?
Hi, I'm at a loss to explain this... I have an ASPX page that I can't always navigate to. When I developed the app (it's Starter Kit Portal-based), I did it on my LAN and have had no trouble accessing the page. However, upon deployment, I see the following behavior: 1. POST request goes out looking for MyForm.aspx 2. GET request for MyForm.aspx 3. GET request for MyForm.aspx 4. ... X. GET request Sometimes, the page finally loads. Other times, it just ends up blank. Many times, it doesn't load at ALL the first POST - I just get a "The pa...

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 implement this? Thanks! instance name: select @@servername [assumes the DBA has defined a local entry in syservers] db name: select db_name() [can...

How to get IP address/name of the machine
Hi all, 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 Hi, Please try to use my code: public static string IPAddress { get { string userIP; HttpRequest Request = HttpContext....

Getting NIC to get a dynamic IP address from Cable Modem
Does anyone know how to get my NW 6 server to get a dynamic IP address from a cable/DSL modem? Thanks, Kevin DHCPCLNT name=board_name Add /INETCFG to the end of that to have DHCPCLNT update your INETCFG information for you. After it does that, you'll probably need to manually enable Dynamic NAT on the interface. bd NSC Volunteer SysOp ...

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"> <script runat="server"> protected string DNSLookup(string domain) { string result = string.Empty; try { 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. http://forums.asp.net/p/1039283/1443326.aspx#1443326TUFAN01MAN 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 of ASA Server
I have a server running an ASA database and a PowerBuilder application (running on another computer) connects to that database through ODBC. In the DSN settings in ODBC, I just enter the name of the ASA server and my application connects to it. Is there a way (in PowerBuilder) of knowing the IP address or hostname of the computer where the database is running? Thanks. SELECT PROPERTY ('MachineName') FROM dummy; Saini wrote: > I have a server running an ASA database and a PowerBuilder > application (running on another computer) connects to that > database thr...

How to get server name or IP@ in SQA5?
In ASA8/9, we have the machinename property that indicates the server computer name. Is there a way in SQA5 to get the same info? I notice that in SQA5, server computer name/IP@ is in the log file, but I can't find a server/db/connection property for this info. Thanks. What's New in SQL Anywhere Studio What's New in Version 8.0.0 New features in version 8 Adaptive Server Anywhere new features "Administration and troubleshooting" .. . . - New diagnostic properties .. . . The following server properties have been added in this ...

How to get server name and databases name from a server using SQL Command...
can anyone tell meHow to get server name and databases name from a server using SQL Command...i m using sql server 2000(T-SQL)-- "Mark As Answer" If my reply helped you --  Use @@SERVERNAME to find the server name -select @@SERVERNAME& this to find the current database name -select db_name()M.V. 'Anil' Radhakrishna Web Development Tips, Tricks & Trivia | My Code Gallery Recent article - How To Create a Custom IE8 Accelerator thanks..... -- "Mark As Answer" If my reply helped you --...

Get IP address from network interface name
Hello! I have been using the TNTFirewall component (NTSet) to retreive the network devices of my computer. I get a lot of information för each device eg. NTFireWall.Connections[I].Name, NTFireWall.Connections[I].DeviceName, NTFireWall.Connections[I].GuidId. What I can't find is the currently assigned IP address of each device (if available). How can I get the current IP address assigned to these connections using the above properties? The values are as an example: Name = 'Anslutning till lokalt nätverk' DeviceName = 'Attansic L1 Gigabit Ethernet...

Web resources about - How to get IP address or name of the server? - asp.net.getting-started

IPv4 address exhaustion - Wikipedia, the free encyclopedia
IPv4 address exhaustion is the depletion of the pool of unallocated Internet Protocol Version 4 (IPv4) addresses. The IP address space is managed ...

Outlook online to get a better address book and flight confirmations
... needs extras that attract customers to its offering. Now the company is announcing a couple of updates including improvements to the address ...

The backwards notion that Obama was late for the glamorous 2015 Kennedy Center Honors because he needed ...
Here's the standard presentation of that notion in People Magazine , replete with video, from which I grabbed this still. But I think the address ...

Clinton must choose how to address data breach in Dem debate
The question facing Hillary Clinton is how forcefully to confront Bernie Sanders about the actions of his campaign staff.

Figure out how to address your cover letter - Business Insider Deutschland
... a specific individual. Just because a job posting omits the name of the person in charge of the hiring process doesn't mean you should address ...

​Hillary Clinton to address homegrown terror threat
Democratic front-runner will speak in Minneapolis Tuesday afternoon

Clinton to address terror protection
As domestic terror fears rise, Hillary Clinton is set to explain how she will protect Americans, reports NBC News.

House Republican: Obama Came Out Worse After Oval Office Address
House Republican: Obama Came Out Worse After Oval Office Address

In weekly address, Obama asks Americans to 'stay true to who we are' in fight against terrorism
x YouTube Video This week, like last week, President Obama devoted his weekly address to the fight against terrorism. As I said in my speech ...

Congress Shockingly Fails to Address Alleged EPA Lawbreaking
Right now, the EPA is making Congress look foolish.

Resources last updated: 12/20/2015 1:13:55 AM