如何限制网站的一部分,以便一次只能由一台计算机查看? [英] How can I restrict the part of a website so that it can be viewed by only one computer at a time?

查看:99
本文介绍了如何限制网站的一部分,以便一次只能由一台计算机查看?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用C#Visual Studio 2008和SQL Server 2005.

Using C# Visual Studio 2008 and SQL Server 2005.

  • 一台数据库服务器.

  • One database server.

一个网络服务器

三个客户

网页名称为alpha.网站名称为mysite.

Webpage name is alpha. Site name is mysite.

我希望一次只能有一个客户端可以查看页面alpha.如果一个人正在查看该页面,而另一个人正在另一台计算机上尝试查看同一页面,则访问被拒绝.

I want that only one client at a time can view the page alpha. If one is viewing the page and another from another computer tries to view the same page, access is denied.

是否可以通过任何方式配置IIS,从而限制连接到特定页面的计算机?

Is there any way to configure IIS so limit computers connecting to a particular page?

是否可以通过使用静态类来实现此目的,以便仅创建该类的一个实例,而另一个实例尝试产生错误?

Is it possible to achieve this by using a static class so that only one instance of this class is made and when another tries to make ERROR?

如何实现?

请注意,页面很多.我只想在此页面上限制人们的观点.

Please note, there are many pages. I only want to restrict people' views on this page.

推荐答案

您描述的方式没有内置限制,我不确定应该使用哪种静态类.

There are no built in limits the way you describe, and I am not sure what a static class is supposed to help with.

我将使用应用程序变量,存储第一个客户端的IP地址和一些超时,然后在您要以这种方式保护的页面上进行设置/选中.

I would use an application variable, storing the IP address of the first client and some sort of timeout and set/check this on the page you want to protect in this manner.

这篇关于如何限制网站的一部分,以便一次只能由一台计算机查看?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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