Function DeCodeAnsi(s)
Dim i, sTmp, sResult, sTmp1
sResult = ""
For i=1 To Len(s)
If Mid(s,i,1)="%" Then
sTmp = "&H" & Mid(s,i+1,2)
If isNumeric(sTmp) Then
If CInt(sTmp)=0 Then
i = i + 2
ElseIf CInt(sTmp)>0 And CInt(sTmp)<128 Then
sResult = sResult & Chr(sTmp)
i = i + 2
Else
If Mid(s,i+3,1)="%" Then
sTmp1 = "&H" & Mid(s,i+4,2)
If isNumeric(sTmp1) Then
sResult = sResult & Chr(CInt(sTmp)*16*16 + CInt(sTmp1))
i = i + 5
End If
Else
sResult = sResult & Chr(sTmp)
i = i + 2
End If
End If
Else
sResult = sResult & Mid(s,i,1)
End If
Else
sResult = sResult & Mid(s,i,1)
End If
Next
DeCodeAnsi = sResult
End Function
Dim i, sTmp, sResult, sTmp1
sResult = ""
For i=1 To Len(s)
If Mid(s,i,1)="%" Then
sTmp = "&H" & Mid(s,i+1,2)
If isNumeric(sTmp) Then
If CInt(sTmp)=0 Then
i = i + 2
ElseIf CInt(sTmp)>0 And CInt(sTmp)<128 Then
sResult = sResult & Chr(sTmp)
i = i + 2
Else
If Mid(s,i+3,1)="%" Then
sTmp1 = "&H" & Mid(s,i+4,2)
If isNumeric(sTmp1) Then
sResult = sResult & Chr(CInt(sTmp)*16*16 + CInt(sTmp1))
i = i + 5
End If
Else
sResult = sResult & Chr(sTmp)
i = i + 2
End If
End If
Else
sResult = sResult & Mid(s,i,1)
End If
Else
sResult = sResult & Mid(s,i,1)
End If
Next
DeCodeAnsi = sResult
End Function
解决方案 »
- vss 获取web项目(不可用)
- ASP.Net求教育 Button1点击不进后台!
- 【提问】问一个关于fckEditor2.6版本的上传问题~!
- 请教!!!!!!!!
- |M| 如何让我的Div层显示在网页的中间 用CSS ------------ 谢谢
- 向 httpModules 里添加元素有什么用?
- 求救好心人,我想往数据库中插入一条时间的数据,我用文本的形式无法插入,请问,该用什么格式来插入时间的数据?高手们帮帮我吧!我很急
- 怎样在程序中使用第三方控件
- 两个服务器上的数据库怎样保持同步
- asp.net做的网页,如何使所有的网页都屏蔽掉工具栏和地址栏?
- 无限级分类存储过程及在APS.NET2.0下的使用
- 怎样取消DataGrid控件自动按数值型绑定列排序的属性
StringToWideChar 将ANSI字符串转换为UNICODE字符串
WideCharLenToString 函数 将ANSI字符串转换为UNICODE字符串
WideCharLenToStrWar 函数 将UNICODE字符串转换为ANSI字符串变量
WideCharToString 函数 将UNICODE字符串转换为ANSI字符串
WideCharToStrVar 函数 将UNICODE字符串转换为ANSI字符串变量
感谢所有回复的朋友。
http://www.developerfusion.co.uk/utilities/convertvbtocsharp.aspx
是 Char.IsNumeric
{
string returnValue;
int i;
string sTmp;
string sResult;
string sTmp1;
sResult = "";
for (i = 0; i < s.Length; i++)
{
if (s.Substring(i,1) == "%")
{
sTmp = "&H" + s.Substring(i+1,2);
if (Information.IsNumeric(sTmp))
{
if (System.Convert.ToInt32(sTmp) == 0)
{
i = i + 2;
}
else if (System.Convert.ToInt32(sTmp) > 0 && System.Convert.ToInt32(sTmp) < 128)
{
sResult = sResult + Strings.Chr(System.Convert.ToInt32(sTmp));
i = i + 2;
}
else
{
if (s.Substring(i+3,1) == "%")
{
sTmp1 = "&H" +s.Substring(i+4,2);
if (Information.IsNumeric(sTmp1))
{
sResult = sResult + Strings.Chr(System.Convert.ToInt32(sTmp) * 16 * 16 + System.Convert.ToInt32(sTmp1));
i = i + 5;
}
}
else
{
sResult = sResult + Strings.Chr(System.Convert.ToInt32(sTmp));
i = i + 2;
}
}
}
else
{
sResult = sResult + s.Substring(i,1);
}
}
else
{
sResult = sResult + s.Substring(i,1);
}
}
returnValue = sResult;
return returnValue;
}