public void rebootButtonClick(object sender, EventArgs e) { MenuItem mi = (MenuItem)sender; Droplet d = (Droplet)mi.Tag; rebootDropletRequest = String.Format("https://api.digitalocean.com/droplets/{0}/reboot/?client_id={1}&api_key={2}", d.id, clientID, apiKey); Console.WriteLine(rebootDropletRequest); HttpWebRequest request = (HttpWebRequest)WebRequest.Create(rebootDropletRequest); request.Timeout = 5000; request.UserAgent = "Digital Ocean Indicator"; HttpWebResponse response = (HttpWebResponse)request.GetResponse(); StreamReader responseStream = new StreamReader(response.GetResponseStream()); responseString = responseStream.ReadToEnd(); Console.WriteLine(responseString); response.Close(); responseStream.Close(); }
public void dropletItemClick(object sender, EventArgs e) { MenuItem mi = (MenuItem)sender; Droplet d = (Droplet)mi.Tag; Console.WriteLine(d.id); }