问题详情

答题翼 > 问答 > 求职面试 > 正文
目录: 标题| 题干| 答案| 搜索| 相关

第四题:在ASP 中,Server中有一个方法是URLEncode(string) 如: response.write Server.URLEncode(


第四题:在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的逆函数。

请帮忙给出正确答案和分析,谢谢!

参考答案
答案整理中……
您可能感兴趣的试题