VB函数 - URL Encode

 时间:2024-10-12 03:17:21

1、Public Function URLEncode(ByVal strParameter As String) As StringDim s As StringDim I As IntegerDim intValue As IntegerDim TmpData() As Byte s = "" TmpData = StrConv(strParameter, vbFromUnicode) For I = 0 To UBound(TmpData) intValue = TmpData(I) If (intValue >= 48 And intValue <= 57) Or _ (intValue >= 65 And intValue <= 90) Or _ (intValue >= 97 And intValue <= 122) Then s = s & Chr(intValue) ElseIf intValue = 32 Then s = s & "+" Else s = s & "%" & Hex(intValue) End If Next I URLEncode = sEnd Function

2、这个VB的函数,可以把中文转化为相应的URL Encode。

3、形参为中文等字符。

4、返回值为形参对应的URL Encode。

  • 四季豆土豆炖肉
  • 牙周检查流程和注意事项
  • win7 XNA4.0安装失败,错误代码2350怎么办
  • VS中自动键盘切换如何进行关闭
  • 奇迹仙侠新手怎么玩?
  • 热门搜索
    红包数字代表的意思大全 香椿芽的储存方法 脸上痤疮的治疗方法 jl4g18发动机怎么样 红鲫鱼怎么养 猪肉怎么做好吃 怎么做馒头又软又好吃 社会科学研究方法 燃气灶打不着火原因和处理方法 橄榄油的美容方法