|
-
Jun 16th, 2003, 02:44 AM
#1
Thread Starter
Hyperactive Member
*RESOLVED* Error with Xor in VB.Net
Hi folks,
I've made a cypher class in VB.Net, but every time i run the project i get the following error. What is wrong here???
An unhandled exception of type 'System.ArgimentException' occured in Microsoft.Visualbasic.dll
Additional information: Procedure call or argument is not valid.
On the line self (bold) i get te following description:
This code has called into another function. When that function is finisched, this is the next statement that will be executed.
Class:
Private Sub DoXor()
dim lngC as integer
dim intB as integer
dim lngN as integer
for lngN = 0 to mvarText.length
lngC = Asc(Mid(mvarText, lngN,1))
intB = Int(Rnd * 256)
>>>Mid(mvarText, lngN,1) = Chr(lngC Xor intB)
Next
End sub
Public Function Decrypt(byval vData as String) as String
DoXor()
Decrypt = mvarText
End Function
Can please someone help me.
Thanxxx
Last edited by hassa046; May 9th, 2005 at 06:49 AM.
-
Jun 16th, 2003, 02:53 AM
#2
Sleep mode
I'm not sure if this would help you out but you better see this little demo that uses Xor function .
http://www.experts-exchange.com/Prog..._20462872.html
-
Jun 16th, 2003, 07:31 AM
#3
Thread Starter
Hyperactive Member
Originally posted by Pirate
I'm not sure if this would help you out but you better see this little demo that uses Xor function .
I took a look at it but it seems a whole other approach. Can you help me to implement my functionalities in that of the example?
Thanxxx
-
Jul 3rd, 2003, 07:51 AM
#4
Thread Starter
Hyperactive Member
Is there nobody that can help me?
All the examples that i find can't give me the same result as i use in my own.
My only question is to look what's wrong with my code.
Lots of greets
Ismail
-
Jul 3rd, 2003, 10:28 AM
#5
Lively Member
Equiv Logic Statement
Do you have to use Xor, or can you use an equiv logic stmt
such as
a xor b = (a or b) and not (a and b)
db
-
Jul 3rd, 2003, 10:36 AM
#6
Thread Starter
Hyperactive Member
I've attached the file, to let you see my intention. probably it's self-explaining.
:-)
-
Jul 3rd, 2003, 05:59 PM
#7
Sleep mode
Why do you post VB6 code here ?? If you still insist to use it though , then I dunno , otherwise , I have Encryption/Decryption routines . They work well . If you want them let me know (but they don't use XOR) .
-
Jul 3rd, 2003, 05:59 PM
#8
Sleep mode
Or you may look into using Cryptography class in .NET .
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|