从服务器获取Domain Base Url [英] getting Domain Base Url from a server

查看:53
本文介绍了从服务器获取Domain Base Url的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经为我的应用程序服务器指出了2个url,这意味着用户可以使用任何一个URL登录

(比如一个示例用户可以浏览www.xxx.com和www.yyy .com)。

现在,我从服务器获取基本URL时遇到问题。



早期我们只使用了一个域名网址比如www.xxx.com,那个时候我没有任何问题需要获得基本URL。



当我通过代码获得基本URL时,它会给出正确的基本URL www .xxx.com。



但是在用两个URL指出之后,我们得到了基本URL的问题



例如



当我尝试通过代码获取基本网址时,我的浏览器网址是www.xxx.com。基本网址将是www.xxx.com



当我尝试通过代码获取基本网址时,我的浏览器网址是www.yyy.com。基本URL仅限www.xxx.com ...但我的基本网址应该是www.yyy.com



请帮助我获得正确的基本网址C#代码。







感谢和问候

Arun R

解决方案

检查这个链接

I have pointed out 2 url for my application server, which means user can login with any of that url
(Say for an example user can browse with www.xxx.com and www.yyy.com).
Now, i have a problem with getting base URL from my server.

Early we have used only one domain url say www.xxx.com,that time i dont have any problem to get base URL.

When ever i got base URL through code,it gives right base URL www.xxx.com.

But after pointing out with two URL's, we got problem to get base URL's

For example

When i try to get base url through code, when my browser url is www.xxx.com. The base url will be www.xxx.com

When i try to get base url through code, when my browser url is www.yyy.com. The base URL will be www.xxx.com only... but my base url should be www.yyy.com

Please help me to get right base url through the C# code.



thanks and regards
Arun R

解决方案

Check this link


这篇关于从服务器获取Domain Base Url的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆