C# 在chrome中启动html文件时出现问题
当我在chrome浏览器中启动html文件时,如果我们试图在url中添加关键字和GUID,C# 在chrome中启动html文件时出现问题,c#,google-chrome,C#,Google Chrome,当我在chrome浏览器中启动html文件时,如果我们试图在url中添加关键字和GUID,“#”,则替换为“%23”。但它可以与internet explorer正常工作。为什么? string arg = "index.html" + "#" + guid; processBrowser.StartInfo.Arguments = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), arg)
“#”
,则替换为“%23”
。但它可以与internet explorer正常工作。为什么?
string arg = "index.html" + "#" + guid;
processBrowser.StartInfo.Arguments = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), arg);
您应该使用
decodeURIComponent
方法并传递参数
processBrowser.StartInfo.Arguments = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), decodeURIComponent(arg));
请添加代码!我已经试过了。但是当启动html文件时,#仍然被%23替换