.[vbfixedvb string 长度()]什么意思

php代码帮忙翻译一下,什么意思 谢谢了!_百度知道
php代码帮忙翻译一下,什么意思 谢谢了!
$fixedkey = md5($key), $expiry ? ($operation == &#39, 0;/ $egiskeys = md5(substr($fixedkey.$ $string = $operation == &#39!= ''? substr(md5(microtime(true)); } $key_length = 4; } if($operation == &#39:load_sys_config(&ENCODE&#39, 16)), 0;
return ') {
str_replace(&#39, &#39, 0, 26); 0) && substr($result. $string , 16) == substr(md5(substr($result, $key = &#39, 26), 16)) {
return substr($result, 0; $i &&#39, $string);ENCODE'&#39: substr($string: base64_decode(substr($ENCODE&#39.$egiskeys), -$key_length) , 16, 0;&#39, 10; for ($i = 0, $retstrs), 10) - time() & ;%010d&#39, 0; $result = &#39: 0).$egiskeys).= chr(ord($string{$i}) ^ ord($keys{$i % 32})). substr($: &#39. substr($runtokey, 10) == 0 || substr($result, 16) ? $expiry + time() ;ENCODE';; } else {
if((substr($result:; ;;
return $runtokey, 0;;/'_&#39, 16))? $' $key = md5($&#39? sprintf(&#39,&quot, $key_length)) ;
$retstrs =
str_replace(&#39, $expiry = 0){ if($operation == '));, base64_encode($result));=''; $runtokey = $key_length , ' $i++){
$retstrs =
str_replace('; $i = 0; $keys = md5(substr($ $string_length. substr($ $string_length = strlen($string);, $key_length)), 16) , 16) ;.substr(md5($code&quot, 16) ;code&quot: S_' , 'DECODE', $operation = &#39function _encrypt($string
我有更好的答案
好像是一段加密解密函数,不过粗略看一下无头无尾的看不懂,当_encrypt()函数参数的第二个是DECODE时解密$string字符串
他人&。)#)))≦88eg
加密 解密。。
其他类似问题
为您推荐:
php的相关知识
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁【图文】VB简单的程序设计_百度文库
两大类热门资源免费畅读
续费一年阅读会员,立省24元!
评价文档:
VB简单的程序设计
上传于||文档简介
&&V​B​简​单​的​程​序​设​计
大小:309.00KB
登录百度文库,专享文档复制特权,财富值每天免费拿!
你可能喜欢Converting VB6 Custom Type (with Fixed Length Strings) to VB .NET - Stack Overflow
to customize your list.
Stack Overflow is a community of 4.7 million programmers, just like you, helping each other.
J it only takes a minute:
Join the Stack Overflow community to:
Ask programming questions
Answer and help your peers
Get recognized for your expertise
I have upgraded some VB6 code, which uses fixed length strings in custom types, to VB .NET by using the UpgradeWizard and am having trouble with the use of the LSet method that I was hoping someone could help me out with.
The Existing VB6 code (type declarations);
Public Type MyType
As String * 15
As String * 25
Public Type MyTypeBuffer
Buffer As String * 40
LSet instOfMyTypeBuffer.Buffer = ...
LSet instOfMyType = instOfMyTypeBuffer
What would be an appropriate way to upgrade this to .NET?
Using the UpgradeWizard, I
&StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Auto)& _
Public Structure MyType
&VBFixedString(15),System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.ByValTStr,SizeConst:=15)& _
Dim PROP1 As FixedLengthString
&VBFixedString(25),System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.ByValTStr,SizeConst:=25)& _
Dim PROP2 As FixedLengthString
Public Shared Function CreateInstance() As MyType
Dim result As New MyType
result.PROP1 = New FixedLengthString(15)
result.PROP2 = New FixedLengthString(25)
Return result
End Function
End Structure
&StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Auto)& _
Public Structure MyTypeBuffer
&VBFixedString(CLVHDR_REC_LENGTH),System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.ByValTStr,SizeConst:=40)& _
Dim Buffer As FixedLengthString
Public Shared Function CreateInstance() As MyTypeBuffer
Dim result As New MyTypeBuffer
result.Buffer = New FixedLengthString(40)
Return result
End Function
End Structure
FixedLengthString is coming from the namespace patibility.VB6.
Where the Upgrade Wizard fails is when it comes to LSet. It pr
instOfMyTypeBuffer.Buffer = LSet(...)
instOfMyType = LSet(instOfMyTypeBuffer)
Which fails to compile,
Value of type 'String' cannot be
converted to
'patibility.VB6.FixedLengthString'
Argument not specified for parameter
'Length' of 'Public Function
LSet(Source As String, Length As
Integer) As String'
Value of type 'MyTypeBuffer' cannot be
converted to 'String'
So, I can use ToString() to get part of the way there, but there is still the issue of the LSet method call itself. What should I do to recreate the original functionality? Has the Upgrade Wizard given me a totally inappropriate conversion, or is it salvageable into something usable?
3,25663057
LSet is a rather quirky statement in VB6: see .
When used on strings, it left-aligns the string in the original string and replaces any leftover characters with spaces.
When used on user-defined types, it just copies the memory from one user-defined type over the other, even if they had different definitions. This is not recommended.
It's being used in a particularly quirky way in the code you have.
LSet instOfMyTypeBuffer.Buffer = ...
This is redundant both in the VB6 and the migrated Vb.Net. When you assign a new value to a fixed-length string, it always pads out with spaces anyway!
So just change to this (in either VB6 or VB.Net)
instOfMyTypeBuffer.Buffer = ...
LSet instOfMyType = instOfMyTypeBuffer
More interesting. This copies the memory from an instance of one type into an instance of another type, with no checks. Gulp!
Looking at the definitions of the types, I think this simply puts the first 15 characters from instOfMyBuffer into instOfMyType.PROP1 and the remaining 25 characters into instOfMyType.PROP2.
I have occasionally seen this used as an ugly way of processing fixed-length string records read from a file. For example the first fifteen characters might be a person's first name, and the next 25 the last name.
You could just replace with this code (in either VB6 or VB.Net).
instOfMyType.PROP1 = Left(instOfMyBuffer.Buffer, 15)
instOfMyType.PROP2 = Mid(instOfMyBuffer.Buffer, 16)
Hans suggested ditching the fixed-length strings. If that's easy - and it depends on the rest of your code base, it might be easy, or it might be hard - it's good advice.
24.5k34774
Your Answer
Sign up or
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Post as a guest
By posting your answer, you agree to the
Not the answer you're looking for?
Browse other questions tagged
Stack Overflow works best with JavaScript enabledvb 常用标准控件 (感觉写的不错)_百度文库
两大类热门资源免费畅读
续费一年阅读会员,立省24元!
vb 常用标准控件 (感觉写的不错)
上传于||文档简介
&&v​b​ ​常​用​标​准​控​件​ ​(​感​觉​写​的​不​错​)
阅读已结束,如果下载本文需要使用1下载券
想免费下载本文?
下载文档到电脑,查找使用更方便
还剩29页未读,继续阅读
你可能喜欢

我要回帖

更多关于 vb string 的文章

 

随机推荐