473,734 Members | 2,567 Online
Bytes | Software Development & Data Engineering Community
+ 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.asp x" web domain of the site
(http://www.mysite.com/).
How can I get it?

Thank you.
Nov 19 '05 #1
3 6382
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.asp x" 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.UserAge nt
... and so on...

Antonio
http://www.futureblogs.net/antonio
Nov 19 '05 #2
Use Request.Uri.Get LeftPart(UriPar tial.Authority) . Or
UriPartial.Some thing else.

Grtz, Wouter vanVugt
blogs.infosuppo rt.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.ToS tring
Dim FQDN As New Uri(Url1)
Dim dns As String
dns = FQDN.GetLeftPar t(UriPartial.Au thority)

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

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******@hotma il.com> wrote in message
news:11******** *************@g 14g2000cwa.goog legroups.com...
Use Request.Uri.Get LeftPart(UriPar tial.Authority) . Or
UriPartial.Some thing else.

Grtz, Wouter vanVugt
blogs.infosuppo rt.com/wouterv

Nov 19 '05 #4

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

Similar topics

2
29478
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 the domain (in this case www.com.com, www.nl.sd, weblog.lastpak.nl and testing.stupid.com),so stripping of the http://
1
1079
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 presuming that this will require an unsafe method call to an API call, but I can't find the API syntax necessary.
2
1471
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 browsers such as Firefox? It's a hypothetical question as the app we're writing is internal and the companies standard is IE. I was about to stupidly ask if the same technique works with another web server but then we couldn't run ASP.NET anyway :-)...
3
2721
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 possible to do it via $_POST. Thanks,
13
12409
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 accessing the page, I ran into the security problem with making a cross domain request. I have been reading that with JSON a cross domain request can be accomplished, but have not been able to find any examples on how to use it or how to get the return...
11
5845
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
1186
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 one application would fail to return it? Both have <authentication mode="Windows"/in the web.config file. Any help would be appreciated. David
6
8632
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 tried, including my conclusions/assumptions (which i'll happily be corrected on if it solves my problem!): The requirement not to use a proxy means I can't use the synchronous
1
4511
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 my code: Dim iEx As New MySoap.TInfoEx iEx.Value1 = 1
0
8776
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9449
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9310
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9236
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8186
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4550
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3261
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 we have to send another system
2
2724
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2180
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.