如何将多个 MVC.net 应用程序与其他 MVC.net 应用程序连接?
How to connect Multiple MVC.net Application with other MVC.net Applications?
是否可以让 ASP.NET MVC 服务器与其他 MVC.net 应用程序通信? (示例如图 link )
Example
客户端首先与主服务器通信。主服务器将他的请求重定向到其他服务器之一。客户端不能直接与其他服务器通信。它应该始终通过主服务器。
所以当用户请求时 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();
}
是否可以让 ASP.NET MVC 服务器与其他 MVC.net 应用程序通信? (示例如图 link )
Example
客户端首先与主服务器通信。主服务器将他的请求重定向到其他服务器之一。客户端不能直接与其他服务器通信。它应该始终通过主服务器。
所以当用户请求时 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();
}