Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/xml/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 在chrome中启动html文件时出现问题_C#_Google Chrome - Fatal编程技术网

C# 在chrome中启动html文件时出现问题

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)

当我在chrome浏览器中启动html文件时,如果我们试图在url中添加关键字和GUID,
“#”
,则替换为
“%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替换