[Mono-devel-list] Login application

Jurandy Martins Soares Junior jurandy at lsd.ic.unicamp.br
Tue Aug 10 10:15:47 EDT 2004


Hi, all!

I'm new in the list (but not in C#).

Does anyone know how to write in C# a sample application for login?

Something similar to the one below, written in Python.

Regards,
Jurandy Martins

----------------------------
#!/usr/bin/python
import crypt, getpass, pwd

def login():
    username = raw_input('Python login:')
    cryptedpasswd = pwd.getpwnam(username)[1]
    if cryptedpasswd:
        if cryptedpasswd == 'x' or cryptedpasswd == '*':
            raise "Sorry, currently no support for shadow passwords"
        cleartext = getpass.getpass()
        if crypt.crypt(cleartext, cryptedpasswd[:2]) == cryptedpasswd:
            print "Authentication succeed!"
        else:
            print "Failure login!"

login()
----------------------------



More information about the Mono-devel-list mailing list