Mono.Upcoming.AuthenticatedConnection.CreateToken C# (CSharp) Method

CreateToken() public method

public CreateToken ( string frob ) : void
frob string
return void
        public void CreateToken(string frob)
        {
            Response rsp = Util.Get ("auth.getToken", new UpcomingParam ("frob", frob));
            token = rsp.Token;
        }

Usage Example

コード例 #1
0
ファイル: Authenticated.cs プロジェクト: mono/upcoming-sharp
    public static void Main()
    {
        AuthenticatedConnection connection = new AuthenticatedConnection (API_KEY);

        Console.WriteLine ("Goto {0}", connection.FrobUrl);
        Console.WriteLine ("Authenticate and paste the frob");
        Console.Write("Here: ");
        string frob = Console.ReadLine ();
        Console.WriteLine ();

        connection.CreateToken (frob);

        Watch[] watches = connection.GetWatchList ();

        foreach (Watch w in watches) {
         	Event e = w.GetEvent ();
            Console.WriteLine ("Name: {0} - Id: {1}", e.Name, e.ID);
            Console.WriteLine ("StartDate : {0}", e.StartDate);

            Venue v = e.GetVenue ();
            Console.WriteLine ("Venue: {0} - City: {1}", v.Name, v.City);
            Console.WriteLine ();
        }
    }