示例#1
0
文件: MainPage.xaml.cs 项目: dej-27/j
        private void ListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            var lisbox = sender as ListBox;
            var picure = lisbox.SelectedItem as Picture;

            var account = "*****@*****.**";
            var password = "******";
            GooglePicasaService service = new GooglePicasaService();
            service.Login(account, password, (authResult) =>
            {
                WebClient client = new WebClient();

                client.Headers["Authorization"] = String.Format("GoogleLogin auth={0}", authResult);
                client.Headers["Content-Type"] = "image/jpeg";
                client.Headers["Slug"] = picure.Name;

                Stream picStream = picure.GetImage();

                UploadFile(client, picStream, account);
            });
        }
示例#2
0
        private void ListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            var lisbox = sender as ListBox;
            var picure = lisbox.SelectedItem as Picture;


            var account  = "*****@*****.**";
            var password = "******";
            GooglePicasaService service = new GooglePicasaService();

            service.Login(account, password, (authResult) =>
            {
                WebClient client = new WebClient();

                client.Headers["Authorization"] = String.Format("GoogleLogin auth={0}", authResult);
                client.Headers["Content-Type"]  = "image/jpeg";
                client.Headers["Slug"]          = picure.Name;


                Stream picStream = picure.GetImage();

                UploadFile(client, picStream, account);
            });
        }