Advertisement
diegographics

Untitled

Mar 5th, 2015
182
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.41 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10. using System.Diagnostics;
  11. using Wordpress;
  12.  
  13. namespace WordpressDemoApp
  14. {
  15.     public partial class Form1 : Form
  16.     {
  17.         private Api wordpress = new Wordpress.Api("http://diego.graphics/", "api", "diego.graphics", "54b928ca4d56c");
  18.         public Form1()
  19.         {
  20.             wordpress.SetControlers(true, true, true, true, true, true);
  21.             InitializeComponent();
  22.         }
  23.  
  24.         private void trackBar1_Scroll(object sender, EventArgs e)
  25.         {
  26.             label1.Text = trackBar1.Value.ToString();
  27.         }
  28.         private void TestRequest(string json)
  29.         {
  30.             Debug.WriteLine("Knock Knock, Neo.");
  31.             Debug.WriteLine("TestRequest says: " + json);
  32.             //label1.Text = json;
  33.         }
  34.  
  35.         private void button1_Click(object sender, EventArgs e)
  36.         {
  37.             WebApi request = new Wordpress.WebApi(wordpress.UriConstruct("info"));
  38.             request.Callback = button1_Response;
  39.             request.StartWebRequest();
  40.         }
  41.         private void button1_Response(string json)
  42.         {
  43.             Debug.WriteLine(json);  // Funktioniert
  44.             //JsonPreview.Text = json;   // Führt zum Error
  45.         }
  46.     }
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement