Results 1 to 10 of 15

Thread: [vbnet/C#/Python] Basic clraik Authorization

Threaded View

  1. #1
    Zachafer's Avatar
    Joined
    Dec 2011
    Posts
    1,235
    Userbars
    11
    Thanks
    769
    Thanked
    1,466/678
    DL/UL
    98/0
    Mentioned
    512 times
    Time Online
    24d 13h 9m
    Avg. Time Online
    8m

    [vbnet/C#/Python] Basic clraik Authorization

    VBNet:
    Code:
        Private Shared Function Authorize(ByVal User As String, ByVal Pass As String, ByVal Rank As String) As Boolean
            If User.Length = 0 Then
                MessageBox.Show("Please insert a clraik username!", "clraik Authorization")
            ElseIf Pass.Length = 0 Then
                MessageBox.Show("Please insert a clraik password!", "clraik Authorization")
            Else
                Dim wc As System.Net.WebClient = New System.Net.WebClient()
                Dim HTML As String = wc.DownloadString("http://clraik.com/forum/auth.php?u=" & User & "&p=" & Pass & "&r=" & Rank)
                Return HTML.Contains("<status>Authorized</status>")
            End If
            Return False
        End Function
    C#:
    Code:
            private static bool Authorize(string user, string pass, string rank)
            {
                if (user.Length == 0)
                {
                    MessageBox.Show("Please insert a clraik username!", "clraik Authorization");
                }
                else if (pass.Length == 0)
                {
                    MessageBox.Show("Please insert a clraik password!", "clraik Authorization");
                }
                else
                {
                    System.Net.WebClient wc = new System.Net.WebClient();
                    string HTML = wc.DownloadString("http://clraik.com/forum/auth.php?u=" + user + "&p=" + pass + "&r=" + rank);
                    return HTML.Contains("<status>Authorized</status>");
                }
                return false;
            }
    Python:
    Code:
    def authorization():
        username = username.get() #from entry1
        password = password.get() #from entry2
        webFile = urllib2.urlopen('http://clraik.com/forum/auth.php?u=' + username + '&p=' + password + '&r=' + rank).read()
        print(webFile)
        if "<status>Authorized</status>" in webFile:
            return tkMessageBox.showinfo("clraik authorization", "Authorized")
        else:
            return tkMessageBox.showinfo("clraik authorization", "Not Authorized")
    RANK PARAMETER VALUES:

    1=NEWBIE
    2=CLRAIK
    3=OFFICIAL CLRAIK
    4=TOP CLRAIK
    5=CLRAIK MASTER
    6=CLRAIK VIP
    Last edited by j03; 08-15-2015 at 10:43 AM.

  2. The Following 8 Users Say Thank You to Zachafer For This Useful Post:

    Coolguy (05-06-2015),Ghosts (12-02-2014),j03 (11-17-2014),jojo (03-16-2012),Ryan~ (03-16-2012),Water (11-22-2014),watersniper (06-25-2013),ZombieAttack (05-16-2017)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •