帮忙把用foxpro写的函数改成用vb.net (谢谢)
用foxpro写的函数如下,帮忙改成用vb.net, 谢谢大家!
LPARAMETERS cPassWord
LOCAL I,cPwd,ch
cPwd= ' '
FOR I=1 TO LEN(cPassWord)
ch=SUBS(cPassWord,I,1)
IF ch# ' '
if asc(ch)#159
cPwd=m.cPwd+CHR(ASC(m.ch)*2)
endif
ELSE
cPwd=m.cPwd+ ' '
ENDIF
ENDFOR
RETURN cPwd
cPassWord:字符串(輸入值)
cPwd__:加密字符串(返回_值)
[解决办法]
Public Function _FunctionName(ByVal cPassWord As String)
Dim i As Integer
Dim cPwd As String = " "
Dim ch As Char
For i = 1 To Len(cPassWord)
ch = Mid(cPassWord, i, 1)
If ch <> " " Then
If Asc(ch) <> 159 Then
cPwd = cPwd & Chr(Asc(ch) * 2)
End If
Else
cPwd = cPwd & " "
End If
Next
Return cPwd
End Function