I have created a C# code where I'll input a code to it and it returns me an encrypted entry pass code. Its all working perfectly. Now the question is that, I want to apply this code to every application I create so that only after getting the pass code, the application should run. As far as I know, I now insert that C# code file to that application and everytime am linking that code files.

For a C# application its fine, but when I create application using VB.NET, I am forced to convert the code file written in C# to VB everytime. I have heard about DLL and class files. But I am not sure how to apply this further.

Help is wanted for me as to how:

  • I should create DLL (or class) file out that C# Code file
  • How I should send and retrieve the values from that file
  • How should I make it available for both C# and VB application.

Thanks for your time.

To build a dll, type this from the command line
csc /target:library /out:<dll_name>.dll <list of .cs files to make up dll>

After that just add the dll to your upcoming projects

can I return and pass the value exactly as I did with the c# code file before?

Without knowing exactly how you code works, maybe...
The methods of a dll become available to your code once it is added but if it requires things like displaying text then there is an visual element that needs to be taken into account.