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中自动键盘切换如何进行关闭
  • 奇迹仙侠新手怎么玩?
  • 热门搜索
    肾不好怎么调理 睾丸痛怎么回事 外耳道炎治疗方法 怎么炸元宵 方法检出限 选择性粘贴怎么用 儿童诗歌大全100首 子宫腺肌症怎么治疗 烩菜的家常做法 汉字大全