我有一阵列,有URLs,如<编码>http://www.example.com?a=1&b=2&c=3,我需要每个URL Encodes。
但是,如果我使用<条码>的话。 缩略语
Is there anyway to achieve this?
此外,参数值不仅可能具有空间,而且可能具有“安乐”的标志。
我有一阵列,有URLs,如<编码>http://www.example.com?a=1&b=2&c=3,我需要每个URL Encodes。
但是,如果我使用<条码>的话。 缩略语
Is there anyway to achieve this?
此外,参数值不仅可能具有空间,而且可能具有“安乐”的标志。
由于大家的回答,你帮助我找到我可以使用的解决办法。
Dim sURL As String = "http://www.example.com?a=1 1&b=2 2&c=3 3"
Dim sURLParameters = sURL.Split("?")
Dim parameters As NameValueCollection
parameters = HttpUtility.ParseQueryString(sURLParameters(1))
sURL = sURLParameters(0) & "?"
For i As Integer = 0 To parameters.Count - 1
sURL += parameters.Keys(i).ToString & "=" & Server.UrlEncode(parameters.Item(i).ToString)
Next
Response.Write(sURL)
这一联系使我成为“四方”解决办法。
做你想要做的事情的箱子方法不多。 从方案角度看,“安乐”,在“金色”中,它无法建立起来。
而且,乌尔都语党正在设立,拟通过URL派出,因此,它将取代(或)其他特性。
保证你能够 采用插手法,但这很可能造成不参加的结果。
你可以这样做:
string oldUrl = "http://www.example.com?a=1 1&b=2 2&c=3 3"
string oldUrlSplit = oldUrl.Split( ? );
string newUrl = oldUrlSplit[0] + HttpUtility.URLEncode(oldUrlSplit[1]);
显然,你想要取消检查等。
Edit:
我略微不提这一球。 您还将在<条码>和>上将旧的UrlSplit 等同起来;,随后在<条码>上将其分成“<>/代码>,然后在<条码>上,然后在<条码>上将“URLEncode”部分(在<条码><>>>>>后)分开。 参看“Anthony Pegram”,
http://www.example.com?a=1%201&b=2%202&c=203”rel=“nofollow” http://www.example.com?a=1%201&b=2%202&c=3%203。
你们可以看看,内部空间是如何转换到20%的,但只有实际变量“1 1”“2 2”“3 3”,实际输入<代码>。 HttpServerUtility.URLEncode()
与Mitchel一样,这部金塔将成为箱子解决办法的一部分,但你可以这样进行一些干预,以便将这些变量用于乌尔都编码。
As a learning experience I recently tried implementing Quicksort with 3 way partitioning in C#. Apart from needing to add an extra range check on the left/right variables before the recursive call, ...
I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...
I have two EF entities. One has a property called HouseNumber. The other has two properties, one called StartHouseNumber and one called EndHouseNumber. I want to create a many to many association ...
I m using decimal type (.net), and I want to see if two numbers are equal. But I only want to be accurate to 10 decimal places. For example take these three numbers. I want them all to be equal. 0....
I m creating an STA version of the SynchronizationContext for use in Windows Workflow 4.0. I m wondering what to do about exceptions when Post-ing callbacks. The SynchronizationContext can be used ...
I ve got some code which sets up a datacontext. Often enough, the datacontext should be set to some underlying data collection, such as an ObservableCollection - but occasionally I d like to set it ...
I am building an application with C#. I managed to turn this into a single instance application by checking if the same process is already running. Process[] pname = Process.GetProcessesByName("...
NOTE I have asked the related question (with an accepted answer): How to combine DataTrigger and Trigger? I think I need to combine an EventTrigger and a DataTrigger to achieve what I m after: when ...