Last post Nov 10, 2017 11:22 PM by PaulTheSmith
Nov 06, 2017 07:04 AM|moris27|LINK
I have couple custom functions for encrypting string,rounding,etc
to be accessible in my Asp project I put them into a class called SharedFuncs and used like this
if (passw == new SharedFuncs().DecryptString128Bit(op.PASS, "encrkey"))
it is that a good practice?
Nov 07, 2017 09:42 AM|Eric Du|LINK
According to your description, as far as I know, you want to call some methods from the other project in asp.net, please check the following sample and explanations:
How can I refer to a project from another one in c#?
Sharing is Caring: Using Shared Projects in ASP.NET:
Nov 07, 2017 11:09 AM|moris27|LINK
Hi.at this moment I don't want to share between other project,just inside my project I want to use some functions in all my project code.
Nov 08, 2017 10:04 AM|Eric Du|LINK
The answer is OK, you could put these methods in the class, then in your page code behind(add class reference first) call method that in that class.
For more details, please check the following tutorial:
Creating a Class and Call it from Main Program:
Nov 08, 2017 07:12 PM|moris27|LINK
It is possible to use that functions without creating a new instance ?
new SharedFuncs().DecryptString128Bit(op.PASS, "encrkey"))
just using DecryptString128Bit(...)?
I've done something like this in VB.NET with modules
One solution is to use a
Nov 10, 2017 11:22 PM|PaulTheSmith|LINK
Put your shared functions in a static class and then use the 'import static' declaration to reduce the noise in your code