- 积分
- 23274
- 明经币
- 个
- 注册时间
- 2018-11-7
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
发表于 2019-7-13 14:48:25
|
显示全部楼层
本帖最后由 1291500406 于 2019-7-15 10:54 编辑
' 半角转全角
Dim fso,TestFile
url = "demon"
Half2Full(url)
Function Half2Full(ByVal s)
Dim i
For i = &H0021 To &H007E
s = Replace(s, ChrW(i), ChrW(i + &HFEE0))
Next
Set fso=CreateObject("Scripting.FileSystemObject")
Set TestFile=fso.CreateTextFile("C:\hello.txt",Ture)
TestFile.WriteLine(s)
TestFile.Close
End Function
' 全角转半角
Dim fso,TestFile
url = "demon"
Full2Half(url)
Function Full2Half(ByVal s)
Dim i
For i = &HFF01 To &HFF7E
s = Replace(s, ChrW(i), ChrW(i - &HFEE0))
Next
Set fso=CreateObject("Scripting.FileSystemObject")
Set TestFile=fso.CreateTextFile("C:\hello1.txt",Ture)
TestFile.WriteLine(s)
TestFile.Close
End Function
|
|