473,698 Members | 2,398 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 6380
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
29477
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
1076
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
1469
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
2720
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
12406
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
5837
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
1180
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
8628
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
4510
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
8609
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
9166
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
9030
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
8899
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
8871
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6525
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5861
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3052
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
3
2007
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.