托管 c++ 查找和替换语法

发布于 2024-07-27 20:11:51 字数 354 浏览 4 评论 0原文

我正在构建一个 isapi 过滤器,它将捕获任何带有前缀“http://localhost/”的 url 请求并重定向该请求url 请求到我的消息页面“http://localhost/default.html”。

这是解决方案:

if(urlString.Find("/") != -1) { urlString.Replace(urlString, "/default.html");

I'm building an isapi filter that will grab any url requests with the prefix "http://localhost/" and redirect that url request to my message page "http://localhost/default.html."

Here's the solution:

if(urlString.Find("/") != -1)
{
urlString.Replace(urlString, "/default.html");

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

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

发布评论

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

评论(3

那支青花 2024-08-03 20:11:51

boost字符串算法库有一些有效的替代功能

The boost string algorithm library has some effective replace features.

长伴 2024-08-03 20:11:51

也许您可以使用 RegExp 来完成这项工作! : RegexLib.com

Maybe you may use a RegExp to do the job ! : RegexLib.com

腹黑女流氓 2024-08-03 20:11:51

答案是: if(urlString.Find("/") != -1) { urlString.Replace(urlString, "/default.html");

the answer is: if(urlString.Find("/") != -1) { urlString.Replace(urlString, "/default.html");

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