I'm trying to write a quick commandline app that takes a string from the
commandline and returns a formatted md5 hash. Unfortunately the code won't
comple and returns an error of "No accessible 'Main' method with an
appropriate signature was found"
Anyone have an idea what I need to do to fix this?
Thanks!
Full code follows:
-----------------------------------
Imports System
Imports System.Text
Imports System.Security .Cryptography
Module MD5Return
Function MD5hash(ByVal data() As Byte) As Byte()
' This is one implementation of the abstract class MD5.
Dim md5 As New MD5CryptoServic eProvider()
Dim result As Byte() = md5.ComputeHash (data)
Return result
End Function
Public Sub Main(ByVal args As Char())
Dim clearBytes, hashedBytes As Byte()
If (args Is Nothing OrElse args.Length = 0) Then
clearBytes = New UnicodeEncoding ().GetBytes(arg s)
hashedBytes = MD5hash(clearBy tes)
Console.Write(B itConverter.ToS tring(hashedByt es))
End If
End Sub
End Module
commandline and returns a formatted md5 hash. Unfortunately the code won't
comple and returns an error of "No accessible 'Main' method with an
appropriate signature was found"
Anyone have an idea what I need to do to fix this?
Thanks!
Full code follows:
-----------------------------------
Imports System
Imports System.Text
Imports System.Security .Cryptography
Module MD5Return
Function MD5hash(ByVal data() As Byte) As Byte()
' This is one implementation of the abstract class MD5.
Dim md5 As New MD5CryptoServic eProvider()
Dim result As Byte() = md5.ComputeHash (data)
Return result
End Function
Public Sub Main(ByVal args As Char())
Dim clearBytes, hashedBytes As Byte()
If (args Is Nothing OrElse args.Length = 0) Then
clearBytes = New UnicodeEncoding ().GetBytes(arg s)
hashedBytes = MD5hash(clearBy tes)
Console.Write(B itConverter.ToS tring(hashedByt es))
End If
End Sub
End Module
Comment