473,465 Members | 3,216 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Getting domain from request

Hello.

I'm running my web application at "http://www.mysite.com/MyForm.aspx".
Now I want to get from the request of "MyForm.aspx" web domain of the site
(http://www.mysite.com/).
How can I get it?

Thank you.
Nov 19 '05 #1
3 6367
AF
> Hello.
I'm running my web application at "http://www.mysite.com/MyForm.aspx".
Now I want to get from the request of "MyForm.aspx" web domain of the site
(http://www.mysite.com/).
How can I get it?
Thank you.


Hello David,

The "Request" instance can answer your question. Many parts are available such
as :
Request.Url
Request.Url.*
Request.UserAgent
... and so on...

Antonio
http://www.futureblogs.net/antonio
Nov 19 '05 #2
Use Request.Uri.GetLeftPart(UriPartial.Authority) . Or
UriPartial.Something else.

Grtz, Wouter vanVugt
blogs.infosupport.com/wouterv

Nov 19 '05 #3
Absolutely correct, although there's a couple of gotchas to watch out for.

Dim Url1 As String = Request.Url.ToString
Dim FQDN As New Uri(Url1)
Dim dns As String
dns = FQDN.GetLeftPart(UriPartial.Authority)

Of course, if only the raw domain name is wanted, use :
Dim dnsname As String = Request.Url.Host

Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
<wo******@hotmail.com> wrote in message
news:11*********************@g14g2000cwa.googlegro ups.com...
Use Request.Uri.GetLeftPart(UriPartial.Authority) . Or
UriPartial.Something else.

Grtz, Wouter vanVugt
blogs.infosupport.com/wouterv

Nov 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: BluaP | last post by:
given an url (through a form) like http://www.com.com/sdsfewa/asadasd/asdasdas www.nl.sd/sdfsf/sdfds.xml weblog.lastpak.nl/index.php?id=sdfsd http://testing.stupid.com i want to have only...
1
by: Brian 5 | last post by:
I am trying to find code where I can retrieve either the domain or workgroup to which a Windows 98 machine belongs. The System.Environment.UserDomainName does not work on Windows 98. I am...
2
by: Rob Nicholson | last post by:
Can somebody remind me how you get the domain\username of the client who's accessing an intranet site? I know you have to turn on NT authentication on IIS. Also, does this work with other...
3
by: Joshua Morgan | last post by:
Hey all, I want to write my own SOAP server without using any libraries such as PEAR::SOAP or nusoap. My question is how do I get the soap request from the POST body? It doesn't appear...
13
by: trpost | last post by:
I am looking to make a small web app that will return the status of a website from the client browser. I tried this with AJAX and it worked great locally, but did not work for remote users...
11
by: Jan | last post by:
I'd like a maketable query listing ClientID, and E-mail from another table. This is simple, BUT I'd only like to get only the part after @ in the E-mail. How would this work in MS Access 2003?
1
by: David C | last post by:
I have the following code in 2 web applications in ASP.Net 2.0 and one returns the domain\username and the other does not. strLogin = LoginName1.Page.User.Identity.Name Can anyone tell me why...
6
by: Simon | last post by:
Hi All, An experiment i'm doing requires requires a synchronous cross-domain request, without using a proxy. I wondered if anyone had any ideas to help me achieve this. Below is what I have...
1
by: Jens | last post by:
Hello, I have some code that calls an external webservice. To debug I want to get the Soap message before it's send to the webservice. Is there a way to get the soap message? Some example of...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.