【问题标题】:How to remove % character in the URL (Google Chrome)如何删除 URL 中的 % 字符(谷歌浏览器)
【发布时间】:2017-04-17 09:01:37
【问题描述】:

我有一个用 C# 开发的小应用程序,主要目的是使用 Chrome 根据用户输入在特定网站上搜索某些内容。但在用户输入字符串并使用按钮后,最终 URL 在 Chrome 中打开,包含%,因此,在该网站上找不到该值。如何在 Google Chrome 中避免这种情况?或者也许在 C# 中?谢谢。

代码如下:

private void btnCheck_Click(object sender, EventArgs e)
{
    System.Diagnostics.Process.Start("http://www.mfinante.ro/infocodfiscal.html?cod='" + txtCIF.Text + "'");
}

【问题讨论】:

标签: c# google-chrome


【解决方案1】:

示例代码:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
using System.Web;
namespace Rextester
{ public class Program {
 public static void Main(string[] args){
string url = "localhost:8080/Site/List/hello%20test%20A89";
string newUrl=System.Web.HttpUtility.UrlDecode(url);
 Console.WriteLine(newUrl);}}}

输出: localhost:8080/Site/List/hello test A89

【讨论】:

猜你喜欢
  • 1970-01-01
  • 2015-04-06
  • 1970-01-01
  • 2019-05-09
  • 1970-01-01
  • 1970-01-01
  • 2012-11-13
  • 2014-02-24
  • 2012-11-29
相关资源
最近更新 更多