Advertisement
Guest User

Untitled

a guest
Oct 27th, 2016
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.49 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Net;
  6. using System.Threading.Tasks;
  7. using Microsoft.Azure.WebJobs;
  8.  
  9. namespace Bot
  10. {
  11.     // To learn more about Microsoft Azure WebJobs SDK, please see http://go.microsoft.com/fwlink/?LinkID=320976
  12.     class Program
  13.     {
  14.         static string token = "хуй";
  15.         static string apiurl = "https://api.vk.com/method/";
  16.         // Please set the following connection strings in app.config for this WebJob to run:
  17.         // AzureWebJobsDashboard and AzureWebJobsStorage
  18.         static void Main()
  19.         {
  20.             var host = new JobHost();
  21.             // The following code ensures that the WebJob will be running continuously
  22.             string url = apiurl + "status.set?" + "text=helloworld" + "&access_token=" + token;
  23.             //string url = "https://oauth.vk.com/access_token?client_id=5578051&client_secret=хуй&redirect_uri=https://oauth.vk.com/blank.html&code=" + "хуй";
  24.             HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
  25.             HttpWebResponse response = (HttpWebResponse)request.GetResponse();
  26.             var stream = response.GetResponseStream();
  27.             byte[] buf = new byte[1000];
  28.             stream.Read(buf, 0, 1000);
  29.             var str = System.Text.Encoding.Default.GetString(buf);
  30.             Console.WriteLine(str);
  31.             System.Threading.Thread.Sleep(5 * 60 * 1000);
  32.             host.RunAndBlock();
  33.         }
  34.     }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement