When I do that I get the following error
Warning 1 Access of shared member, constant member, enum member or nested type through an instance; qualifying expression will not be evaluated. C:\Documents and Settings\bhmahler\My Documents\Visual Studio 2005\Projects\EDMS\EDMS\frmAdministration.vb 3267 9 EDMS
with this code
VB Code:
Dim enc As Encrypt.StringEncrypt
enc.Encrypt("Hello")
This is my class for the dll
VB Code:
Imports System.Text
Imports System.Security.Cryptography
Imports System
Imports System.IO
Public Class StringEncrypt
Public Shared Function Encrypt(ByVal strText As String) As String
Dim strPwd As String = "***"
Dim i As Integer, c As Integer
Dim strBuff As String = String.Empty
For i = 1 To Len(strText)
c = Asc(Mid$(strText, i, 1))
c = c + Asc(Mid$(strPwd, (i Mod Len(strPwd)) + 1, 1))
strBuff &= Chr(c And &HFF)
Next i
Return strBuff
End Function
Public Sub New()
MyBase.New()
End Sub
Public Shared Function Decrypt(ByVal strText As String) As String
Dim strPwd As String = "***"
Dim i As Integer, c As Integer
Dim strBuff As String = String.Empty
For i = 1 To Len(strText)
c = Asc(Mid$(strText, i, 1))
c = c - Asc(Mid$(strPwd, (i Mod Len(strPwd)) + 1, 1))
strBuff = strBuff & Chr(c And &HFF)
Next i
Return strBuff
End Function
Public Shared Function GenerateHash(ByVal text As String) As String
Dim Ue As New UnicodeEncoding()
Dim ByteSourceText() As Byte = Ue.GetBytes(text)
Dim Md5 As New MD5CryptoServiceProvider()
Dim ByteHash() As Byte = Md5.ComputeHash(ByteSourceText)
Return Convert.ToBase64String(ByteHash)
End Function
End Class