gpt4 book ai didi

c# - 如何将多个 MVC.net 应用程序与其他 MVC.net 应用程序连接?

转载 作者:太空宇宙 更新时间:2023-11-03 15:09:06 25 4
gpt4 key购买 nike

是否有可能拥有一个与其他 MVC.net 应用程序通信的 ASP.NET MVC 服务器? (示例显示在图片链接中)

Example enter image description here

客户端首先与主服务器通信。主服务器将他的请求重定向到其他服务器之一。客户端不能直接与其他服务器通信。它应该始终通过主服务器。

所以当用户请求 MainServer.com 时

MainServer 会将用户定向到以下任一项:
S1.MainServer.com
S2.MainServer.com
S3.MainServer.com

注意 S1、S2 和 S3 在物理上彼此分开。

最佳答案

试试这个:

public ActionResult Index()
{
if (!S1.Server.IsBusy())
{
return new RedirectResult("http://S1.MainServer.com");
}
else if(!S2.Server.IsBusy())
{
return new RedirectResult("http://S2.MainServer.com");
}
else if (!S3.Server.IsBusy())
{
return new RedirectResult("http://S3.MainServer.com");
}
else return View();
}

关于c# - 如何将多个 MVC.net 应用程序与其他 MVC.net 应用程序连接?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41975521/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com