|
-
Feb 22nd, 2011, 10:57 PM
#1
Thread Starter
Addicted Member
[RESOLVED] Help Calling Added Existing Item
I took a .vb file and imported it into my project which is supposed to encrypt and decrypt a users password. I am trying to call this from my main form inside a button and I am having trouble with it.
I have a function in there that I need to call and take the input from textbox1 and then either encrypt it or decrypt it and display that in textbox 2 but I can't figure out how to do that.
Here is what I'm doing now...
TextBox2.Text = TextBox1.Text(Namespace.Function)
That is not working so that can't be it. I did this once before and it worked but I can't remember how I did it.
Any advice guys?
-
Feb 22nd, 2011, 11:03 PM
#2
Re: Help Calling Added Existing Item
it would be better if you can post your Encrypt and Decrypt function as it will help us to know what parameter it accepts. apart from that normally you call function like this:
Code:
TextBox2.Text = Namespace.ClassName.FunctionName(TextBox1.Text)
__________________
Rate the posts that helped you 
-
Feb 22nd, 2011, 11:30 PM
#3
Thread Starter
Addicted Member
Re: Help Calling Added Existing Item
I tried that and here is what I'm getting.
Code:
Reference to a non-shared member requires an object reference.
-
Feb 22nd, 2011, 11:38 PM
#4
Re: Help Calling Added Existing Item
As per above exception you first need to create a new instance of your class and than call this method.for e.g.
Code:
dim objClass as new Namespace.ClassName()
TextBox2.Text = objClass.FunctionName(TextBox1.Text)
__________________
Rate the posts that helped you 
-
Feb 22nd, 2011, 11:45 PM
#5
Thread Starter
Addicted Member
Re: Help Calling Added Existing Item
Thank You!
That worked!!
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
|