网友您好, 请在下方输入框内输入要搜索的题目:
第四题:在ASP 中,Server中有一个方法是URLEncode(string)
如: response.write Server.URLEncode("Test.ASP?TestNum=100&TestStr=你好")
结果输出: Test%2EASP%3FTestNum%3D100%26TestStr%3D%C4%E3%BA%C3
在ASP 中,有ASC(String),Hex(Number),Mid(String,start,[,length])这三个可能用
到的函数,如果是三个函数的用法
如:
ASC("A")=65,ASC("你")= -15133
Hex(65)="41",Hex(-15133)="C4E3"
Mid("hello",2,1)="e", mid("this is test!",9,2)="te"
现在要求编写编码函数 Function TestEncode(SourceString),及一个解码函数
Function TestDecode(CodeString)。TestEncode(SourceString)是将SourceString
串中非字母且非汉字且非数字的字符转换为对应Ansi编码的十六进制编码!
如:
TestEncode("Test.ASP?TestNum=100&TestStr=你好")=
"Test%2EASP%3FTestNum%3D100%26TestStr%3D 你好"
而TestDecode(CodeString)是将编码的串还原,是TestEncode的逆函数。
参考答案
更多 “ 第四题:在ASP 中,Server中有一个方法是URLEncode(string)如: response.write Server.URLEncode("Test.ASP?TestNum=100TestStr=你好")结果输出: Test%2EASP%3FTestNum%3D100%26TestStr%3D%C4%E3%BA%C3在ASP 中,有ASC(String),Hex(Number),Mid(String,start,[,length])这三个可能用到的函数,如果是三个函数的用法如:ASC("A")=65,ASC("你")= -15133Hex(65)="41",Hex(-15133)="C4E3"Mid("hello",2,1)="e", mid("this is test!",9,2)="te"现在要求编写编码函数 Function TestEncode(SourceString),及一个解码函数Function TestDecode(CodeString)。TestEncode(SourceString)是将SourceString串中非字母且非汉字且非数字的字符转换为对应Ansi编码的十六进制编码!如:TestEncode("Test.ASP?TestNum=100TestStr=你好")="Test%2EASP%3FTestNum%3D100%26TestStr%3D 你好"而TestDecode(CodeString)是将编码的串还原,是TestEncode的逆函数。 ” 相关考题
![瑞牛题库 章节练习 历年真题 模拟试卷](http://assets.51tk.com/51_sidebar_right_index.jpg)