如何在Web Config中解析服务器路径 [英] How to resolve server path in Web Config

查看:78
本文介绍了如何在Web Config中解析服务器路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经完成了与网站的付款集成.
对于返回URL通知,我在Web配置中使用http://localhost:...
定义了地址 但这在服务器更改时不起作用...
所以请告诉我,我可以在网络配置中设置一些内容来解析路径吗?
我可以在.cs文件中获取服务器名称,但我想在Web配置中设置它.
在Advance中致谢

I have done payment integration with my website.
For the return url notyfication i have define address in web config with http://localhost: ...
but this will not work as the server changes ...
so please tell me that can i set something in web config to resolve path.
i can get server name in .cs file but i want to set this in web config..

Thanks in Advance

推荐答案

如果您要谈论的是单个服务器,则不要在配置文件中使用具有预期url结构的服务器名称.

如果您说服务器可以随时更改请求,则需要在config中定义url的结构,并根据响应url将config中的url形成/修改为当前服务器的url.

因此,无论哪种情况,都应定义所需的URL结构.如果服务器名称是硬编码,则为硬编码;如果服务器名称是多个,则将其设置为运行时.
If you are talking of single server than use that servername with expected url structure in your config file.

If you are saying that the server can change for requests at time then you need to define the structure of the url in config and form/modify the url in config to current server ones based on the response url.

So in either situation, define the URL structre expected. Hardcode the server name if its one and set it runtime if more than one.


这篇关于如何在Web Config中解析服务器路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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