打开HTML文件,查询字符串 [英] Opening html file with query string

查看:321
本文介绍了打开HTML文件,查询字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有可能与加载查询字符串本地HTML文件?我使用的Process.Start,但因为追加?查询字符串=测试来的文件名末尾使搜索失败。

Is it possible to load a local HTML file with a query string? I'm using Process.Start, but that fails because appending ?querystring=test to the end of the filename makes it search for that.

Process.Start("page.html?querystring=test") 

以上在FileNotFound异常结果的代码。我使用的ProcessStartInfo尝试,并通过查询字符串作为参数,但只是装正常的页面。这可能吗?

The code above results in a FileNotFound exception. I've tried using ProcessStartInfo and pass the query string as an argument, but that just loaded the normal page. Is this possible?

推荐答案

这是不可能的,因为查询字符串是HTTP协议的一部分,所以它们只是在一个文件工作从Web服务器提供服务。本地HTML文件只是从文件系统读取。

It's not possible because query strings are a part of HTTP protocol and so they only work when a file is served from a web server. A local HTML file is simply read from the file system.

这篇关于打开HTML文件,查询字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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