Opening html file with query string

随声附和 提交于 2019-12-20 02:15:07

问题


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") 

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?


回答1:


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.



来源:https://stackoverflow.com/questions/13545871/opening-html-file-with-query-string

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!