public void SendFile() { if (this._currentPostTask != null) { return; // don't post the 2nd time } string url = "http://posttestserver.com/post.php?dir=wp7posttest"; var parameters = new Dictionary<string, object>(); parameters.Add("name", this.PhotoName); parameters.Add("photo", this._photoBytes); this._currentPostTask = new HttpPostImageClass(url, parameters, this.OnPostCompleted); this._currentPostTask.OnError = this.OnPostError; this._currentPostTask.Execute(); }
private void OnPostCompleted(string response) { this.PostResultMessage = response; this.IsPostCompleted = true; this._currentPostTask = null; }
private void OnPostError(string message) { this.PostResultMessage = message; this.IsPostCompleted = true; this._currentPostTask = null; }