// code to launch when image data has been uploaded to server, can return error so handle it private void svc_UploadImageCompleted(object sender, UploadImageCompletedEventArgs e) { //check if uploaded if (e.Error == null) { //It Worked :D //Now need to add the photo to the database and save it. //MessageBox.Show(e.Result.ToString(), "Success", MessageBoxButton.OK); //Need the URl the picture is located at string URL = e.Result.ToString(); //now the theme park ID int ThemeParkID = parkID; //Now need the User ID that will be added to the system. try { WebClient addPhoto = new WebClient(); addPhoto.UploadStringAsync(new Uri("http://themeparkcloud.cloudapp.net/Service1.svc/photoadd?uid=" + UserID + "&tpid=" + ThemeParkID + "&photourl=" + URL), "POST"); addPhoto.UploadStringCompleted += addPhoto_UploadStringCompleted; } catch { MessageBox.Show("A network Failure has occured"); } } else { //It Failed :'( MessageBox.Show(e.Error.Message, "Unsuccessful", MessageBoxButton.OK); } }
// code to launch when image data has been uploaded to server, can return error so handle it private void svc_UploadImageCompleted(object sender, UploadImageCompletedEventArgs e) { //check if uploaded if (e.Error == null) { //It Worked :D //Now need to add the photo to the database and save it. //MessageBox.Show(e.Result.ToString(), "Success", MessageBoxButton.OK); //Need the URl the picture is located at string URL = e.Result.ToString(); //now the theme park ID int ThemeParkID = parkID; //Now need the User ID that will be added to the system. try { WebClient addPhoto = new WebClient(); addPhoto.UploadStringAsync(new Uri("http://themeparkcloud.cloudapp.net/Service1.svc/photoadd?uid=" + UserID + "&tpid=" + ThemeParkID + "&photourl=" + URL), "POST"); addPhoto.UploadStringCompleted += addPhoto_UploadStringCompleted; } catch { MessageBox.Show("A network Failure has occured"); } } else { //It Failed :'( MessageBox.Show(e.Error.Message, "Unsuccessful", MessageBoxButton.OK); } }
void HandleClientUploadImageCompleted(object sender, UploadImageCompletedEventArgs e) { loading.Hide(true); Console.WriteLine (e.Result); }
private void Al_UploadImageCompleted(object sender, UploadImageCompletedEventArgs e) { MessageBox.Show(e.Result); }
private void Al_UploadImageCompleted(object sender, UploadImageCompletedEventArgs e) { MessageBox.Show(e.Result); }