问题
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