没有多线程的 ASP 经典 GET 请求

发布于 2024-08-06 14:19:25 字数 375 浏览 1 评论 0原文

我们谈论的是经典 ASP,而不是 ASP.NET!

让我们从顶部开始。我们正在使用 ISAPI_Rewrite,并且希望动态地为我们的客户提供控制 url 重写的功能(给他们提供 httpd.ini 不是一个选项)。我们认为所有未知的 url 请求(我们在 httpd.ini 中定义)都由一个 asp 文件控制,该文件创建一个 GET 请求来选择 url(客户创建键 -> 值表)。现在,我们可以向另一个页面发出请求并仅打印输出,但我们无法向我们自己的服务器发出请求。据我所知,ASP 不提供此功能。

我们可以编写一个 .NET 扩展来控制它,但我们正在寻找其他选项。我知道 .NET 的衰落是一件愚蠢的事情,但这是一个很长的故事......

ASP 中有解决这个问题的方法吗?

We are talking about Classic ASP and NOT ASP.NET!

Lets start from top. We are using ISAPI_Rewrite and we would like to dynamically offer our customers to control rewriting of urls (giving them httpd.ini is not an option). We were thinking that all unknown url requests (we define this in httpd.ini) are controlled by one asp file which creates a GET request to select url (customers creates key -> value table). Now, we can make a request to another page and just print the output but we cannot make a request to our own server. As I am aware, ASP doesnt offer this.

We could write a .NET extension to control this but we are looking for other options. I know that declining .NET is a stupid thing, but its a long story...

Is there a solution to this problem in ASP?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

深白境迁sunset 2024-08-13 14:19:25

看看 Server.Execute 它允许动态(运行时)代码包含其他 ASP 文件。额外的好处是它被视为原始请求的一部分,因此 SESSION、COOKIE 在包含的文件中都可用。然而,主控中定义的变量不可用于包含的页面。不过,您可以使用临时会话变量来规避此问题。

Session("variable") = "value";
Server.Execute(url);
Session.Abandon;
Response.end;

Session.Abandon 将清除所有会话变量,您可能需要单独清除它们。

Have a look at Server.Execute it allows dynamic (run time) code inclusion of other ASP files. An added bonus is that it's treated as part of the original request so SESSION, COOKIE are all available in the included file. HOWEVER variables defined in the master are not available to the included the page. You circumvent this using temporary Session variables though.

Session("variable") = "value";
Server.Execute(url);
Session.Abandon;
Response.end;

Session.Abandon will clear ALL session variables, you might want to clear them individually.

梦里°也失望 2024-08-13 14:19:25

您可以向自己的服务器发出请求,但发出请求的页面不需要在页面顶部的页面声明中启用会话:

每个页面都会锁定会话对象及其阻止您向您的服务器发出请求的对象。自己的服务器。如果您声明您不会在调用脚本中使用会话,那么它不会锁定它,您可以使用 XMLRequest 再次运行它,并在查询字符串、发布数据和会话 cookie 上传递您喜欢的内容,因此会话等仍然会发生。存在。

You can make a request to your own server but the page making the request needs to NOT have session enabled in the page declaration right at the top of the page:

Each page locks the session object and its that which stops you making a request to your own server. If you declare you are not going to use session in the calling script then it wont lock it and you can run it again using a XMLRequest and pass what you like on the querystring, post data and session cookies too so session etc. will all still exist.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文