L
Leon
My web application allow the user to enter the site by typing in a subdomain
such as 'name.domain.com'. However, I want to retrieve just the 'name' part
of the subdomain. see code below (the equal sign '=' respresent the value
I'm getting when I run the code)
Test 1.........................name.domain.com
Dim sdmlink As String = Request.Url.ToString
Dim sdm As Regex
sdm = New Regex("http://(?!www\.)(.*)(\.domain\.com.*)")
Context.Items("Test") = (sdm.Replace(sdmlink, "$1")) ---->> =
http://name.doman.com/welcome.aspx ---- this should = name
Test 2................name.domain.com
Dim sdmlink As String = Request.Url.ToString
Dim sdm As Regex
sdm = New Regex("http://(?!www\.)(.*)(\.domain\.com.*)")
Context.Items("Test") = (sdm.Replace(sdmlink,
"test/default.aspx?Id=$1")) ---->> = test/default.aspx?Id=name ---- this is
correct
such as 'name.domain.com'. However, I want to retrieve just the 'name' part
of the subdomain. see code below (the equal sign '=' respresent the value
I'm getting when I run the code)
Test 1.........................name.domain.com
Dim sdmlink As String = Request.Url.ToString
Dim sdm As Regex
sdm = New Regex("http://(?!www\.)(.*)(\.domain\.com.*)")
Context.Items("Test") = (sdm.Replace(sdmlink, "$1")) ---->> =
http://name.doman.com/welcome.aspx ---- this should = name
Test 2................name.domain.com
Dim sdmlink As String = Request.Url.ToString
Dim sdm As Regex
sdm = New Regex("http://(?!www\.)(.*)(\.domain\.com.*)")
Context.Items("Test") = (sdm.Replace(sdmlink,
"test/default.aspx?Id=$1")) ---->> = test/default.aspx?Id=name ---- this is
correct